From 086f1976f783468712d11c2ff07051cbd1091850 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:57:41 -0600 Subject: [PATCH 01/36] Create main.yml --- .github/workflows/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9c5559a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,17 @@ +on: + pull_request: + paths: + - '**/validator*' +jobs: + + test_diff: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch_depth: 2 + - run: | + diff = git diff HEAD^ HEAD + echo "$diff" >> $GITHUB_OUTPUT + From 90ee15b4af927d427ae20be1f0db2190add0e948 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Mon, 12 Jun 2023 22:40:32 +0000 Subject: [PATCH 02/36] trigger workflow --- .../3_first_Csharp_program/validator.js | 3 +- package-lock.json | 74 +++++++++++++------ 2 files changed, 52 insertions(+), 25 deletions(-) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 3ae286b..0e8ca8c 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,8 +1,9 @@ - +//foo const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { try{ + const codePath = helper.env.TQ_CSHARP_WORKSPACE_CODE; const results = await anaylzeAndExcuteCode(codePath,"firstCsharpProgram"); diff --git a/package-lock.json b/package-lock.json index 69cccda..ab8275d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,104 +1,130 @@ { "name": "twilioquest-extension", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "balanced-match": { + "packages": { + "": { + "name": "twilioquest-extension", + "version": "0.0.1", + "dependencies": { + "fs-jetpack": "^4.1.0", + "ramda": "^0.27.1" + }, + "engines": { + "twilioquest": "3.1.44" + } + }, + "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "fs-jetpack": { + "node_modules/fs-jetpack": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fs-jetpack/-/fs-jetpack-4.1.0.tgz", "integrity": "sha512-h4nHLIcCaxnXfUWhwP+mLnar03R2DBlqicNvKJG44TJob8RV6GB8EKNwJgSaBeDAfqWhqq01y+Ao96vRwpXlPw==", - "requires": { + "dependencies": { "minimatch": "^3.0.2", "rimraf": "^2.6.3" } }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "glob": { + "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "minimatch": { + "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { + "dependencies": { "wrappy": "1" } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } }, - "ramda": { + "node_modules/ramda": { "version": "0.27.1", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==" }, - "rimraf": { + "node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "requires": { + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" From 390c9333dfd6c97de1750dd5c45e35b91e5dc2bb Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Mon, 12 Jun 2023 22:44:02 +0000 Subject: [PATCH 03/36] test 2 --- .github/workflows/main.yml | 4 ++-- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c5559a..b049c36 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,6 @@ jobs: with: fetch_depth: 2 - run: | - diff = git diff HEAD^ HEAD - echo "$diff" >> $GITHUB_OUTPUT + mydiff = git diff HEAD^ HEAD + echo "$mydiff" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 0e8ca8c..0b534e5 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foo +//foobar const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From a583b336689061a69df4047ef8dfb29483ff73a0 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Mon, 12 Jun 2023 22:49:11 +0000 Subject: [PATCH 04/36] test commit --- .github/workflows/main.yml | 4 ++-- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b049c36..dfc89c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,6 @@ jobs: with: fetch_depth: 2 - run: | - mydiff = git diff HEAD^ HEAD - echo "$mydiff" >> $GITHUB_OUTPUT + + echo "$(git diff HEAD^ HEAD)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 0b534e5..5c55676 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar +//foobar1 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 977cd71a651fa54b5ea7a7e479908e67e820baa7 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Mon, 12 Jun 2023 22:55:59 +0000 Subject: [PATCH 05/36] test 3 --- .github/workflows/main.yml | 5 ++--- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfc89c2..a927e4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,8 +10,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - fetch_depth: 2 + fetch-depth: 2 - run: | - - echo "$(git diff HEAD^ HEAD)" >> $GITHUB_OUTPUT + echo "$(git diff HEAD^1 HEAD)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 5c55676..babb55e 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar1 +//foobar126 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From bcc725d6feaa7d15ec2689224198d166673e8c82 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:34:13 +0000 Subject: [PATCH 06/36] test --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a927e4c..68f341a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,5 @@ jobs: with: fetch-depth: 2 - run: | - echo "$(git diff HEAD^1 HEAD)" >> $GITHUB_OUTPUT + echo "$(git diff -G'(?:foobar)\d+' HEAD^1 HEAD)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index babb55e..584d30f 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar126 +//foobar1263 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From d93308749e56a18d154305485d923044c364f9b9 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:41:26 +0000 Subject: [PATCH 07/36] another test --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68f341a..6ed6e75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,5 @@ jobs: with: fetch-depth: 2 - run: | - echo "$(git diff -G'(?:foobar)\d+' HEAD^1 HEAD)" >> $GITHUB_OUTPUT + echo "$(git diff -G'foobar\d+' HEAD^1 HEAD)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 584d30f..ae10056 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar1263 +//foobar12643 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 0a6f750a0211ac863f6d1b704e78aceb4873945f Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:45:48 +0000 Subject: [PATCH 08/36] test workflow --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ed6e75..cd2ec91 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,5 @@ jobs: with: fetch-depth: 2 - run: | - echo "$(git diff -G'foobar\d+' HEAD^1 HEAD)" >> $GITHUB_OUTPUT + echo "$(git diff -G'foobar' HEAD^1 HEAD)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index ae10056..1181c50 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar12643 +//foobar12643fr const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 7cfdefbd17b9242efb8b67904cbeb30cc347bd68 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:56:52 +0000 Subject: [PATCH 09/36] test again --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cd2ec91..50e6c64 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,5 @@ jobs: with: fetch-depth: 2 - run: | - echo "$(git diff -G'foobar' HEAD^1 HEAD)" >> $GITHUB_OUTPUT + echo "$(git diff -G'foobar' HEAD^1 HEAD --name-only)" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 1181c50..5534963 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar12643fr +//foobar1333 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 91a7c967861ca2e1bf9fd1ce6da27dc3587ea3c7 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Tue, 13 Jun 2023 15:20:59 +0000 Subject: [PATCH 10/36] test again --- .github/workflows/main.yml | 3 ++- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50e6c64..1bac081 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,6 @@ jobs: with: fetch-depth: 2 - run: | - echo "$(git diff -G'foobar' HEAD^1 HEAD --name-only)" >> $GITHUB_OUTPUT + d=$(git diff -G'const' HEAD^1 HEAD --name-only) + echo "$d" >> $GITHUB_OUTPUT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 5534963..c32d531 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,5 +1,5 @@ //foobar1333 -const { anaylzeAndExcuteCode } = require('../../validation'); +const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { try{ From b0447759d94d93d4ad2e3025dc80c8e49485274f Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:16:02 +0000 Subject: [PATCH 11/36] test job output --- .github/workflows/main.yml | 24 +++++++++++++++---- .../3_first_Csharp_program/validator.js | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bac081..4702e19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,30 @@ on: - '**/validator*' jobs: - test_diff: + job1: name: Test runs-on: ubuntu-latest + outputs: + result: ${{ steps.one.outputs.result}} steps: - uses: actions/checkout@v3 with: fetch-depth: 2 - - run: | - d=$(git diff -G'const' HEAD^1 HEAD --name-only) - echo "$d" >> $GITHUB_OUTPUT + + - id: one + run: | + d=$(git diff -G'foobar' HEAD^1 HEAD --name-only) + if [[ $d == *validator*]]; then + echo "result=yes" >> $GITHUB_OUTPUT + fi + + job2: + name: test github output + needs: job1 + runs-on: ubuntu-latest + if: needs.job1.outputs.result == 'yes' + steps: + - run: echo "it worked" + + diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index c32d531..1828774 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar1333 +//foobar13 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From bb1a8e70559eb5da0b34063588cea271dac89759 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:20:18 +0000 Subject: [PATCH 12/36] add space --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4702e19..41a9d52 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: - id: one run: | d=$(git diff -G'foobar' HEAD^1 HEAD --name-only) - if [[ $d == *validator*]]; then + if [[ $d == *validator* ]]; then echo "result=yes" >> $GITHUB_OUTPUT fi diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 1828774..bc65f29 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar13 +//foobar133 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 953e96bd6617aefda00ffb285923b494aa09376c Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:40:30 +0000 Subject: [PATCH 13/36] trivial change --- .github/workflows/main.yml | 4 +++- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41a9d52..86cbd51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,10 @@ jobs: - id: one run: | d=$(git diff -G'foobar' HEAD^1 HEAD --name-only) - if [[ $d == *validator* ]]; then + if [[ -n $d ]]; then echo "result=yes" >> $GITHUB_OUTPUT + else + exit 1 fi job2: diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index bc65f29..eb36c22 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar133 +//foobar1334 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 8890005b391dc2e7dbcd06a9b938679ffa63965f Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:11:25 +0000 Subject: [PATCH 14/36] test regular expression --- .github/workflows/main.yml | 5 ++++- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86cbd51..f5a2798 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,10 @@ jobs: - id: one run: | - d=$(git diff -G'foobar' HEAD^1 HEAD --name-only) + d=$(git diff -G'foobar\d+' HEAD^1 HEAD --name-only) + + echo "$d" + if [[ -n $d ]]; then echo "result=yes" >> $GITHUB_OUTPUT else diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index eb36c22..bfa487b 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar1334 +//foobar543 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From c49a5f1ee6177f866544c99d5f12f3f1b47034be Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:31:38 +0000 Subject: [PATCH 15/36] use simple regex --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5a2798..8bbc5a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - id: one run: | - d=$(git diff -G'foobar\d+' HEAD^1 HEAD --name-only) + d=$(git diff -G'foobar[0-1]+' HEAD^1 HEAD --name-only) echo "$d" diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index bfa487b..4252782 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar543 +//foobar5435 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 96fa04b87a159acaa996dc0863d810c58e3e8839 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:37:01 +0000 Subject: [PATCH 16/36] test with other wildcard --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bbc5a9..c0fad35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - id: one run: | - d=$(git diff -G'foobar[0-1]+' HEAD^1 HEAD --name-only) + d=$(git diff -G'foobar[0-9]*' HEAD^1 HEAD --name-only) echo "$d" diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 4252782..4d5577f 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar5435 +//foobar54350 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 0b493bbf70130c1ade0ee291639febd24bb0b0a1 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:38:26 +0000 Subject: [PATCH 17/36] use plus operator --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0fad35..86df280 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - id: one run: | - d=$(git diff -G'foobar[0-9]*' HEAD^1 HEAD --name-only) + d=$(git diff -G'foobar[0-9]+' HEAD^1 HEAD --name-only) echo "$d" From dd2ac1641d2417efb18169ec7fc7d5e39a1cfb92 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:44:16 +0000 Subject: [PATCH 18/36] test different expression --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86df280..54ce84a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - id: one run: | - d=$(git diff -G'foobar[0-9]+' HEAD^1 HEAD --name-only) + d=$(git diff -G'@[a-z0-9]+' HEAD^1 HEAD --name-only) echo "$d" diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 4d5577f..067556d 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//foobar54350 +//@foobar54350 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From ac40b527bee12ad71cd1df677bfcddf6081031c4 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:47:08 +0000 Subject: [PATCH 19/36] test with variable --- .github/workflows/main.yml | 4 +++- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54ce84a..70b7739 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,10 @@ jobs: fetch-depth: 2 - id: one + env: + PATTERN: '@[a-z0-9]+' run: | - d=$(git diff -G'@[a-z0-9]+' HEAD^1 HEAD --name-only) + d=$(git diff -G'$PATTERN' HEAD^1 HEAD --name-only) echo "$d" diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 067556d..8b90bfd 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350 +//@foobar54350qa const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 4f15f825da396452cee1cdb446e907c1b9dce037 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:55:09 +0000 Subject: [PATCH 20/36] test setting env var at beginning of job --- .github/workflows/main.yml | 5 +++-- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70b7739..34f4995 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,11 +2,14 @@ on: pull_request: paths: - '**/validator*' + jobs: job1: name: Test runs-on: ubuntu-latest + env: + PATTERN: '@[a-z0-9]+' outputs: result: ${{ steps.one.outputs.result}} steps: @@ -15,8 +18,6 @@ jobs: fetch-depth: 2 - id: one - env: - PATTERN: '@[a-z0-9]+' run: | d=$(git diff -G'$PATTERN' HEAD^1 HEAD --name-only) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 8b90bfd..ea5abf3 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qa +//@foobar54350qahj89 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From a75e40113de69ac225e6eff803a6411cf25edb82 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:56:38 +0000 Subject: [PATCH 21/36] try without double qoutes --- .github/workflows/main.yml | 2 +- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34f4995..d9f8551 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - id: one run: | - d=$(git diff -G'$PATTERN' HEAD^1 HEAD --name-only) + d=$(git diff -G$PATTERN HEAD^1 HEAD --name-only) echo "$d" diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index ea5abf3..93957d7 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89 +//@foobar54350qahj89jhfd const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From b333e833c0857c249721c7fa1cc0a59e020a4f0b Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:24:56 +0000 Subject: [PATCH 22/36] commit 1 --- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 93957d7..8ba7078 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd +//@foobar54350qahj89jhfd685 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 698d27ffb130339064f5c3c73153e78e82e51fd4 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:26:16 +0000 Subject: [PATCH 23/36] commit 2 --- levels/botnet/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/events.js b/levels/botnet/events.js index 562b80f..ad704f7 100644 --- a/levels/botnet/events.js +++ b/levels/botnet/events.js @@ -1,6 +1,6 @@ module.exports = function(event, world) { - + // foo } From 4f484d3ce71927359d15b34010dca767c27ff411 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:37:05 +0000 Subject: [PATCH 24/36] change we want to trigger an action on --- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 8ba7078..a170f9f 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685 +//@foobar54350qahj89jhfd685875asf const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From be522f19b2aae73faade6669b261fed20c8dbe91 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:38:13 +0000 Subject: [PATCH 25/36] dummy commit --- levels/botnet/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/events.js b/levels/botnet/events.js index ad704f7..7f003c4 100644 --- a/levels/botnet/events.js +++ b/levels/botnet/events.js @@ -1,6 +1,6 @@ module.exports = function(event, world) { - // foo + // foobar } From e293012f251ef5398770efec669f60374cf05346 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:38:49 +0000 Subject: [PATCH 26/36] another dummy commit to test --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e03c6b9..39af9a6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ ## What is TwilioQuest? TwilioQuest is an educational video game designed to teach a new generation of developers how to change the world with code. TwilioQuest prepares you for real-world programming by helping you configure a local development environment and introducing tools used by professional programmers around the world. From learning how to use your terminal, to coding in Python, JavaScript, and contributing to Open Source projects, TwilioQuest will help you develop practical engineering skills. [Learn more about Twilioquest here](https://www.twilio.com/quest) - ## Getting Started 1. Clone this repository into a folder that holds all your twilioquest extension From 2ccc098d23d13e86e502713ef43afaa96981ad7a Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:21:53 +0000 Subject: [PATCH 27/36] print head commit --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9f8551..58c218c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,9 +19,10 @@ jobs: - id: one run: | - d=$(git diff -G$PATTERN HEAD^1 HEAD --name-only) + d=$(git diff -G$PATTERN HEAD^1 HEAD) echo "$d" + echo "$(git show HEAD^1)" if [[ -n $d ]]; then echo "result=yes" >> $GITHUB_OUTPUT From d787beefb2d87b58d345662045777696d8acc61e Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:22:23 +0000 Subject: [PATCH 28/36] trigger a change --- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index a170f9f..316aa1a 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685875asf +//@foobar54350qahj89jhfd685875asf43 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 7a3e136d3537e607536209bc1f27ff890192ece6 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:22:56 +0000 Subject: [PATCH 29/36] another test commit --- levels/botnet/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/botnet/events.js b/levels/botnet/events.js index 7f003c4..811e713 100644 --- a/levels/botnet/events.js +++ b/levels/botnet/events.js @@ -1,6 +1,6 @@ module.exports = function(event, world) { - // foobar + // foobar346 } From d67e71d4d2693862839fe5310878ddc6477ed877 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:11:38 +0000 Subject: [PATCH 30/36] test if gh api will work --- .github/workflows/main.yml | 29 ++++++++++++------- .../3_first_Csharp_program/validator.js | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58c218c..9035001 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,8 @@ on: pull_request: paths: - '**/validator*' - +env: + GITHUB_PAT: '' jobs: job1: @@ -19,24 +20,32 @@ jobs: - id: one run: | - d=$(git diff -G$PATTERN HEAD^1 HEAD) + d=$(gh pr diff | grep -E $PATTERN) echo "$d" - echo "$(git show HEAD^1)" - if [[ -n $d ]]; then echo "result=yes" >> $GITHUB_OUTPUT else exit 1 fi - - job2: - name: test github output + + set_credentials: + name: Get and set PAT needs: job1 runs-on: ubuntu-latest - if: needs.job1.outputs.result == 'yes' - steps: - - run: echo "it worked" + env: + GITHUB_TOKEN: ${{ github.token }} + OWNER: ${{ github.repository_owner}} + REPO: ${{ github.repository }} + SECRET_NAME: FOO + steps: + - name: Get github pat from secrets + run: | + $( gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/$OWNER/$REPO/actions/secrets/$SECRET_NAME ) >> $GITHUB_PAT + echo $GITHUB_PAT diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 316aa1a..27a4905 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685875asf43 +//@foobar54350qahj89jhfd685875asaf43 const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 26b12a390ec831beeb1e2c5cffb7bd72cb029b80 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:17:05 +0000 Subject: [PATCH 31/36] use correct env name --- .github/workflows/main.yml | 5 ++++- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9035001..3a9c0fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,8 +33,11 @@ jobs: name: Get and set PAT needs: job1 runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write env: - GITHUB_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ github.token }} OWNER: ${{ github.repository_owner}} REPO: ${{ github.repository }} SECRET_NAME: FOO diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 27a4905..8ac6627 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685875asaf43 +//@foobar54350qahj89jhfd685875asaf43as const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From f6b0278940569a766a6ac1215899af628421abb2 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:19:47 +0000 Subject: [PATCH 32/36] use token for both jobs --- .github/workflows/main.yml | 1 + levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a9c0fb..6a9fdd2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest env: PATTERN: '@[a-z0-9]+' + GH_TOKEN: ${{ github.token }} outputs: result: ${{ steps.one.outputs.result}} steps: diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 8ac6627..7d84786 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685875asaf43as +//@foobar54350qahj89jhfd685875asaf43asAS const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From fa6ccb4b27d7d39c2414039cb0202ba35a606673 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:24:55 +0000 Subject: [PATCH 33/36] we dont need job1 --- .github/workflows/main.yml | 1 - levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a9fdd2..330f522 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,6 @@ jobs: set_credentials: name: Get and set PAT - needs: job1 runs-on: ubuntu-latest permissions: contents: read diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 7d84786..b687af7 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfd685875asaf43asAS +//@foobar54350qahj89jhfdfd685875asaf43asAS const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From a66271227aa315effeab2e70dc676d758e4aef52 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:18:03 +0000 Subject: [PATCH 34/36] use gh script action --- .github/workflows/main.yml | 25 ++++++++----------- .../3_first_Csharp_program/validator.js | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 330f522..ee30c3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,25 +30,22 @@ jobs: exit 1 fi - set_credentials: + job2: name: Get and set PAT runs-on: ubuntu-latest permissions: contents: read pull-requests: write - env: - GH_TOKEN: ${{ github.token }} - OWNER: ${{ github.repository_owner}} - REPO: ${{ github.repository }} - SECRET_NAME: FOO - steps: - - name: Get github pat from secrets - run: | - $( gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/$OWNER/$REPO/actions/secrets/$SECRET_NAME ) >> $GITHUB_PAT - echo $GITHUB_PAT + - uses: actions/github-script@v6 + with: + script: | + const s = await github.rest.actions.getRepoSecret({ + owner: context.repo.owner, + repo: context.repo.repo, + secret_name: 'FOO', + }); + + console.log(s) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index b687af7..9c95208 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobar54350qahj89jhfdfd685875asaf43asAS +//@foobadr54350qahj89jhfdfd685875asaf43asAS const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From 982f814fe34e14980bb391704c67287367111a21 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:24:39 +0000 Subject: [PATCH 35/36] chg permissions --- .github/workflows/main.yml | 4 +--- levels/botnet/objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee30c3d..905bf54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,7 @@ jobs: job2: name: Get and set PAT runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write + permissions: write-all steps: - uses: actions/github-script@v6 with: diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 9c95208..458ceb1 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobadr54350qahj89jhfdfd685875asaf43asAS +//@foobadr54350qahj89jhfdfd685875asaf4a3asAS const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) { From de5e14f6839571335e4d67a5f14681c88d5cbdf8 Mon Sep 17 00:00:00 2001 From: La'Kaleigh Harris <35268101+Xlient@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:43:11 +0000 Subject: [PATCH 36/36] use environment and try to access variables --- .github/workflows/main.yml | 14 ++++---------- .../objectives/3_first_Csharp_program/validator.js | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 905bf54..3235af3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,17 +33,11 @@ jobs: job2: name: Get and set PAT runs-on: ubuntu-latest - permissions: write-all + environment: herald + env: + TEXT: ${{ secrets.FOO }} steps: - - uses: actions/github-script@v6 - with: - script: | - const s = await github.rest.actions.getRepoSecret({ - owner: context.repo.owner, - repo: context.repo.repo, - secret_name: 'FOO', - }); + - run: echo $TEXT - console.log(s) diff --git a/levels/botnet/objectives/3_first_Csharp_program/validator.js b/levels/botnet/objectives/3_first_Csharp_program/validator.js index 458ceb1..85753bd 100644 --- a/levels/botnet/objectives/3_first_Csharp_program/validator.js +++ b/levels/botnet/objectives/3_first_Csharp_program/validator.js @@ -1,4 +1,4 @@ -//@foobadr54350qahj89jhfdfd685875asaf4a3asAS +//@foobadr54a350qahj89jhfdfd685875asaf4a3asAS const { anaylzeAndExcuteCode } = require('../../validation'); module.exports = async function (helper) {