From 08415f3652bf069eeaf11f77b7c60d2ff365880b Mon Sep 17 00:00:00 2001 From: Aatman Date: Sat, 16 Sep 2023 17:49:54 +0530 Subject: [PATCH 01/47] testing action --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..8a9c1ffd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions šŸš€ +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "šŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "šŸ§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "šŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "šŸ’” The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "šŸ–„ļø The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "šŸ This job's status is ${{ job.status }}." \ No newline at end of file From 9ed43d3195c3d64ff9ce1d08c1ab528b7e002aa4 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sat, 16 Sep 2023 18:58:53 +0530 Subject: [PATCH 02/47] testing chrome --- .github/workflows/test-chrome.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/test-chrome.yml diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml new file mode 100644 index 00000000..c4fda90c --- /dev/null +++ b/.github/workflows/test-chrome.yml @@ -0,0 +1,32 @@ +name: "Publish on Chrome - TEST" + +on: workflow_dispatch + +jobs: + chrome-publish: + name: "Pre Release Extension" + runs-on: "ubuntu-latest" + environment: + name: main + url: "https://github.com/tattle-made/Uli/releases" + + steps: + - name: "Checkout Development Branch" + uses: actions/checkout@v3 + with: + ref: main + + - name: Get commit SHA + shell: bash + run: | + echo "setting variables" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: "Build and Test" + run: | + cd browser-extension/plugin + ls + pwd + npm install + npm run build + zip extension.zip ./dist/ -r \ No newline at end of file From 2df49a4ec8b42ddcc4f69da498b275212790aa81 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sat, 16 Sep 2023 19:02:22 +0530 Subject: [PATCH 03/47] testing workflow on actions branch --- .github/workflows/test-chrome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index c4fda90c..49bf75da 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -14,7 +14,7 @@ jobs: - name: "Checkout Development Branch" uses: actions/checkout@v3 with: - ref: main + ref: actions - name: Get commit SHA shell: bash From eadb64df9932fba1cac4211e4e79eafda5b04d12 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 09:57:37 +0530 Subject: [PATCH 04/47] updates --- .github/workflows/test-chrome.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 49bf75da..d35f973e 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -1,6 +1,9 @@ name: "Publish on Chrome - TEST" -on: workflow_dispatch +on: + pull_request: + branches: + - main jobs: chrome-publish: @@ -14,7 +17,7 @@ jobs: - name: "Checkout Development Branch" uses: actions/checkout@v3 with: - ref: actions + ref: ${{ github.event.pull_request.head.ref }} - name: Get commit SHA shell: bash From d8a9c27c073289a30208042db6b7080c20cd4753 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 09:58:37 +0530 Subject: [PATCH 05/47] test action --- test.txt.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt.txt diff --git a/test.txt.txt b/test.txt.txt new file mode 100644 index 00000000..c9716832 --- /dev/null +++ b/test.txt.txt @@ -0,0 +1 @@ +testing github actions \ No newline at end of file From 61bb9cd239c987de41bfccf32d595bff179e77f8 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 10:15:01 +0530 Subject: [PATCH 06/47] upating action to run on actions branch --- .github/workflows/test-chrome.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index d35f973e..b9c2c2eb 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -1,18 +1,15 @@ -name: "Publish on Chrome - TEST" +name: "TEST" on: pull_request: branches: - - main + - actions jobs: chrome-publish: name: "Pre Release Extension" runs-on: "ubuntu-latest" - environment: - name: main - url: "https://github.com/tattle-made/Uli/releases" - + steps: - name: "Checkout Development Branch" uses: actions/checkout@v3 From 9bf746d11a326a0862f0a768ab4548a50a6b3c17 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 10:39:11 +0530 Subject: [PATCH 07/47] test action --- test.txt.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.txt.txt b/test.txt.txt index c9716832..ae565c6a 100644 --- a/test.txt.txt +++ b/test.txt.txt @@ -1 +1,3 @@ -testing github actions \ No newline at end of file +testing github actions + +test 2 \ No newline at end of file From eec12d9c32b20134722d09116a7b6bbff14a1313 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 14:50:45 +0530 Subject: [PATCH 08/47] upload artifact action --- .github/workflows/test-chrome.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index b9c2c2eb..5b0e667d 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -29,4 +29,10 @@ jobs: pwd npm install npm run build - zip extension.zip ./dist/ -r \ No newline at end of file + zip extension.zip ./dist/ -r + + - name: "Upload extension.zip as artifact" + uses: actions/upload-artifact@v3 + with: + name: extension + path: browser-extension/plugin/extension.zip From 9649e10fd41f000e82142fecf25ff0278c8980ba Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 14:58:02 +0530 Subject: [PATCH 09/47] test --- test.txt.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test.txt.txt b/test.txt.txt index ae565c6a..b03872fd 100644 --- a/test.txt.txt +++ b/test.txt.txt @@ -1,3 +1,2 @@ testing github actions - -test 2 \ No newline at end of file +- test 3 \ No newline at end of file From cad09d258362ee7e4dca732bf32acd30f03bddbd Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 15:04:15 +0530 Subject: [PATCH 10/47] fix: upload artifact --- .github/workflows/test-chrome.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 5b0e667d..501b1f09 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -9,7 +9,7 @@ jobs: chrome-publish: name: "Pre Release Extension" runs-on: "ubuntu-latest" - + steps: - name: "Checkout Development Branch" uses: actions/checkout@v3 @@ -30,9 +30,9 @@ jobs: npm install npm run build zip extension.zip ./dist/ -r - - - name: "Upload extension.zip as artifact" - uses: actions/upload-artifact@v3 - with: - name: extension - path: browser-extension/plugin/extension.zip + + - name: "Upload extension.zip as artifact" + uses: actions/upload-artifact@v3 + with: + name: extension + path: browser-extension/plugin/extension.zip \ No newline at end of file From c119ea6fea8a752950dfe651635ed8ce32827f93 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 15:07:06 +0530 Subject: [PATCH 11/47] test --- test.txt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.txt.txt b/test.txt.txt index b03872fd..03c00931 100644 --- a/test.txt.txt +++ b/test.txt.txt @@ -1,2 +1,2 @@ testing github actions -- test 3 \ No newline at end of file +- test 4 \ No newline at end of file From d11f058d8c8a88366e584d4b321b90ac4d9854db Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 16:42:03 +0530 Subject: [PATCH 12/47] github token --- .github/workflows/test-chrome.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 501b1f09..20338e00 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -35,4 +35,13 @@ jobs: uses: actions/upload-artifact@v3 with: name: extension - path: browser-extension/plugin/extension.zip \ No newline at end of file + path: browser-extension/plugin/extension.zip + + # - name: Create PR Comment with Artifact Link + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/extension" + # comment_body="You can download the extension artifact [here](${artifact_url})." + # curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST -d "{\"body\":\"$comment_body\"}" "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" + \ No newline at end of file From c46f531c16162473fc18b87ff0656d07dd2a3861 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 16:50:01 +0530 Subject: [PATCH 13/47] github token --- .github/workflows/test-chrome.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 20338e00..09d42561 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,11 +37,10 @@ jobs: name: extension path: browser-extension/plugin/extension.zip - # - name: Create PR Comment with Artifact Link - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/extension" - # comment_body="You can download the extension artifact [here](${artifact_url})." - # curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST -d "{\"body\":\"$comment_body\"}" "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" - \ No newline at end of file + - name: Create PR Comment with Artifact Link + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/extension" + comment_body="You can download the extension artifact [here](${artifact_url})." + curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST -d "{\"body\":\"$comment_body\"}" "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments" From 10d1e2ec13f8b189ca78be15a03b02390793ac29 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 21:51:47 +0530 Subject: [PATCH 14/47] updating comment to github script --- .github/workflows/test-chrome.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 09d42561..3194b0cd 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -38,9 +38,15 @@ jobs: path: browser-extension/plugin/extension.zip - name: Create PR Comment with Artifact Link - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/extension" - comment_body="You can download the extension artifact [here](${artifact_url})." - curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST -d "{\"body\":\"$comment_body\"}" "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments" + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifact_url = `https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.run_id}/artifacts/extension`; + const comment_body = `You can download the extension artifact [here](${artifact_url}).`; + github.issues.createComment({ + issue_number: ${github.event.pull_request.number}, + owner: github.context.repo.owner, + repo: github.context.repo.repo, + body: comment_body + }); From e18b13a9e615d99398c265268ce43c0d421b453c Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 22:13:36 +0530 Subject: [PATCH 15/47] fixing github comment action --- .github/workflows/test-chrome.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 3194b0cd..b6cda906 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -44,9 +44,10 @@ jobs: script: | const artifact_url = `https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.run_id}/artifacts/extension`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - github.issues.createComment({ - issue_number: ${github.event.pull_request.number}, + await github.issues.createComment({ + issue_number: github.context.payload.pull_request.number, owner: github.context.repo.owner, repo: github.context.repo.repo, body: comment_body }); + From 286d418a9ba031f801c3e7101dfa92be49956eed Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 22:27:41 +0530 Subject: [PATCH 16/47] fixing github comment action --- .github/workflows/test-chrome.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index b6cda906..1d631785 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -42,12 +42,11 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const artifact_url = `https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.run_id}/artifacts/extension`; + const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}/artifacts/extension`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - await github.issues.createComment({ - issue_number: github.context.payload.pull_request.number, - owner: github.context.repo.owner, - repo: github.context.repo.repo, + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, body: comment_body }); - From 2b3762479559690f6eba41c48a3874e27dd12dd3 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:04:16 +0530 Subject: [PATCH 17/47] fixing github comment action --- .github/workflows/test-chrome.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 1d631785..0a98a4ba 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,12 +37,25 @@ jobs: name: extension path: browser-extension/plugin/extension.zip + # - name: Create PR Comment with Artifact Link + # uses: actions/github-script@v5 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}/artifacts/extension`; + # const comment_body = `You can download the extension artifact [here](${artifact_url}).`; + # await github.rest.issues.createComment({ + # issue_number: context.payload.pull_request.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: comment_body + # }); - name: Create PR Comment with Artifact Link uses: actions/github-script@v5 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}/artifacts/extension`; + const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, @@ -50,3 +63,4 @@ jobs: repo: context.repo.repo, body: comment_body }); + From 20e7a39c8f4ca651798fee9cd1476091ffb54493 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:15:08 +0530 Subject: [PATCH 18/47] fixing github comment action --- .github/workflows/test-chrome.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 0a98a4ba..e6d5d93f 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,19 +37,6 @@ jobs: name: extension path: browser-extension/plugin/extension.zip - # - name: Create PR Comment with Artifact Link - # uses: actions/github-script@v5 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # script: | - # const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}/artifacts/extension`; - # const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - # await github.rest.issues.createComment({ - # issue_number: context.payload.pull_request.number, - # owner: context.repo.owner, - # repo: context.repo.repo, - # body: comment_body - # }); - name: Create PR Comment with Artifact Link uses: actions/github-script@v5 with: @@ -62,5 +49,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: comment_body - }); - + }); \ No newline at end of file From d58bb69e466a80b5da3b1ae489d3b471022d86f9 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:20:35 +0530 Subject: [PATCH 19/47] fixing github comment action --- .github/workflows/test-chrome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index e6d5d93f..c754aa12 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -42,7 +42,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension`; + const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension.zip`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, From 981a6f61a18468320f30094350420bf392eb81dd Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:26:11 +0530 Subject: [PATCH 20/47] fixing github comment action --- .github/workflows/test-chrome.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index c754aa12..2973d542 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,12 +37,25 @@ jobs: name: extension path: browser-extension/plugin/extension.zip + # - name: Create PR Comment with Artifact Link + # uses: actions/github-script@v5 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension`; + # const comment_body = `You can download the extension artifact [here](${artifact_url}).`; + # await github.rest.issues.createComment({ + # issue_number: context.payload.pull_request.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: comment_body + # }); - name: Create PR Comment with Artifact Link uses: actions/github-script@v5 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension.zip`; + const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, From e974472a6036194feb0b4651111c7a1942a35336 Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:32:38 +0530 Subject: [PATCH 21/47] fixing github comment action --- .github/workflows/test-chrome.yml | 34 +++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 2973d542..1f2eec18 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,6 +37,27 @@ jobs: name: extension path: browser-extension/plugin/extension.zip + - name: Download and Comment Artifact Link + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + name: extension + + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifact_url = `${{ steps.download-artifact.outputs.download_url }}`; + const comment_body = `You can download the extension artifact [here](${artifact_url}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); + # - name: Create PR Comment with Artifact Link # uses: actions/github-script@v5 # with: @@ -50,16 +71,3 @@ jobs: # repo: context.repo.repo, # body: comment_body # }); - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}`; - const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); \ No newline at end of file From 7882d02c36caccbae07cef710e1d5d1cc8fba4ab Mon Sep 17 00:00:00 2001 From: Aatman Date: Sun, 17 Sep 2023 23:37:11 +0530 Subject: [PATCH 22/47] fixing github comment action --- .github/workflows/test-chrome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 1f2eec18..c7957a29 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -49,7 +49,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const artifact_url = `${{ steps.download-artifact.outputs.download_url }}`; + const artifact_url = `${{ steps.download-artifact.outputs.download_url }}/extension.zip`; const comment_body = `You can download the extension artifact [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, From d3cf74e2343a636ea37d96a9875f8aa0388f41cf Mon Sep 17 00:00:00 2001 From: Aatman Vaidya Date: Sun, 17 Sep 2023 23:41:30 +0530 Subject: [PATCH 23/47] testing PR (#5) * testing PR * test * test * test * test * test * test * test * test * test --- test.txt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.txt.txt b/test.txt.txt index 03c00931..f0b87b00 100644 --- a/test.txt.txt +++ b/test.txt.txt @@ -1,2 +1,2 @@ testing github actions -- test 4 \ No newline at end of file +- test 14 \ No newline at end of file From db535f63f8bf27ff1544585401d556f0347c3412 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 10:58:36 +0530 Subject: [PATCH 24/47] fixing github comment action --- .github/workflows/test-chrome.yml | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index c7957a29..c75c7a55 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -37,27 +37,6 @@ jobs: name: extension path: browser-extension/plugin/extension.zip - - name: Download and Comment Artifact Link - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - name: extension - - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifact_url = `${{ steps.download-artifact.outputs.download_url }}/extension.zip`; - const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); - # - name: Create PR Comment with Artifact Link # uses: actions/github-script@v5 # with: @@ -71,3 +50,24 @@ jobs: # repo: context.repo.repo, # body: comment_body # }); + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifacts_url = `${{ github.event.workflow_run.artifacts_url }}`; + const response = await github.request(artifacts_url, { + headers: { + Accept: "application/vnd.github+json", + Authorization: `Bearer ${{ secrets.GITHUB_TOKEN }}` + } + }); + const artifact = response.data.artifacts.find(a => a.name === "extension"); + const artifact_url = artifact.archive_download_url; + const comment_body = `You can download the extension artifact here.`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); From 107df30896dbe6025942958f6ea866eca51cfbec Mon Sep 17 00:00:00 2001 From: Aatman Vaidya Date: Mon, 18 Sep 2023 11:10:53 +0530 Subject: [PATCH 25/47] Test action (#6) * testing PR * test * test * test * test * test * test * test * test * test * test --- test.txt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.txt.txt b/test.txt.txt index f0b87b00..529883d3 100644 --- a/test.txt.txt +++ b/test.txt.txt @@ -1,2 +1,2 @@ testing github actions -- test 14 \ No newline at end of file +- test 15 From 2cf8760e11c7fc73b67213c615c339295e029ec0 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 11:26:41 +0530 Subject: [PATCH 26/47] fixing github comment action --- .github/workflows/test-chrome.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index c75c7a55..28e49c37 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -50,24 +50,3 @@ jobs: # repo: context.repo.repo, # body: comment_body # }); - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifacts_url = `${{ github.event.workflow_run.artifacts_url }}`; - const response = await github.request(artifacts_url, { - headers: { - Accept: "application/vnd.github+json", - Authorization: `Bearer ${{ secrets.GITHUB_TOKEN }}` - } - }); - const artifact = response.data.artifacts.find(a => a.name === "extension"); - const artifact_url = artifact.archive_download_url; - const comment_body = `You can download the extension artifact here.`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); From 8a4429e6150ebdfc0d1afc121da6eef5b5dacc83 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 15:09:52 +0530 Subject: [PATCH 27/47] test using ocktokit --- .github/workflows/test-chrome.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 28e49c37..a4faee42 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -50,3 +50,43 @@ jobs: # repo: context.repo.repo, # body: comment_body # }); + + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { Octokit } = require("@octokit/core"); + + const octokit = new Octokit({ + auth: process.env.GITHUB_TOKEN + }); + + const owner = context.repo.owner; + const repo = context.repo.repo; + const run_id = github.run_id; + const artifact_name = "extension"; + const archive_format = "zip"; + + const response = await octokit.request( + 'GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', + { + owner, + repo, + artifact_id: artifact_name, + archive_format, + headers: { + 'X-GitHub-Api-Version': '2022-11-28' + } + } + ); + + const artifactUrl = response.data.url; + + const comment_body = `You can download the extension artifact [here](${artifactUrl}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); \ No newline at end of file From 8080a5c3dfc6e055ccfcd6f9d97d34e3bef1144d Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 16:19:54 +0530 Subject: [PATCH 28/47] fixing github comment action --- .github/workflows/test-chrome.yml | 49 +++++++------------------------ 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index a4faee42..bf88f514 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -31,11 +31,11 @@ jobs: npm run build zip extension.zip ./dist/ -r - - name: "Upload extension.zip as artifact" - uses: actions/upload-artifact@v3 - with: - name: extension - path: browser-extension/plugin/extension.zip + # - name: "Upload extension.zip as artifact" + # uses: actions/upload-artifact@v3 + # with: + # name: extension + # path: browser-extension/plugin/extension.zip # - name: Create PR Comment with Artifact Link # uses: actions/github-script@v5 @@ -51,42 +51,15 @@ jobs: # body: comment_body # }); - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 + - name: Add Comment with Download Link + uses: actions/github-script@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const { Octokit } = require("@octokit/core"); - - const octokit = new Octokit({ - auth: process.env.GITHUB_TOKEN - }); - - const owner = context.repo.owner; - const repo = context.repo.repo; - const run_id = github.run_id; - const artifact_name = "extension"; - const archive_format = "zip"; - - const response = await octokit.request( - 'GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', - { - owner, - repo, - artifact_id: artifact_name, - archive_format, - headers: { - 'X-GitHub-Api-Version': '2022-11-28' - } - } - ); - - const artifactUrl = response.data.url; - - const comment_body = `You can download the extension artifact [here](${artifactUrl}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, + const comment = `You can download the extension [here](https://github.com/${process.env.GITHUB_REPOSITORY}/raw/${process.env.GITHUB_REF}/browser-extension/plugin/extension.zip).`; + github.issues.createComment({ + issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: comment_body + body: comment, }); \ No newline at end of file From ea7831b9b176ce3ce08aaf65efd05a35723097f2 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 17:04:22 +0530 Subject: [PATCH 29/47] fixing github comment action --- .github/workflows/test-chrome.yml | 36 +++++++++++-------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index bf88f514..bc618b2d 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -31,17 +31,18 @@ jobs: npm run build zip extension.zip ./dist/ -r - # - name: "Upload extension.zip as artifact" - # uses: actions/upload-artifact@v3 - # with: - # name: extension - # path: browser-extension/plugin/extension.zip + - name: "Upload extension.zip as artifact" + uses: actions/upload-artifact@v3 + with: + name: extension + path: browser-extension/plugin/extension.zip - # - name: Create PR Comment with Artifact Link - # uses: actions/github-script@v5 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # script: | + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + echo: "RUN ID - ${{github.run_id}} and ARTIFACT ID - " # const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension`; # const comment_body = `You can download the extension artifact [here](${artifact_url}).`; # await github.rest.issues.createComment({ @@ -49,17 +50,4 @@ jobs: # owner: context.repo.owner, # repo: context.repo.repo, # body: comment_body - # }); - - - name: Add Comment with Download Link - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const comment = `You can download the extension [here](https://github.com/${process.env.GITHUB_REPOSITORY}/raw/${process.env.GITHUB_REF}/browser-extension/plugin/extension.zip).`; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment, - }); \ No newline at end of file + # }); \ No newline at end of file From 25794e9c72b86f9f2e01637f69adba2fa88d7f23 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:03:11 +0530 Subject: [PATCH 30/47] fixing github comment action --- .github/workflows/test-chrome.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index bc618b2d..0e8fb8a1 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -43,11 +43,11 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | echo: "RUN ID - ${{github.run_id}} and ARTIFACT ID - " - # const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/runs/${{ github.run_id }}/artifacts/extension`; - # const comment_body = `You can download the extension artifact [here](${artifact_url}).`; - # await github.rest.issues.createComment({ - # issue_number: context.payload.pull_request.number, - # owner: context.repo.owner, - # repo: context.repo.repo, - # body: comment_body - # }); \ No newline at end of file + const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}`; + const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); \ No newline at end of file From a96338c102977d59c14e7b0d3b7502654f8dfef2 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:12:41 +0530 Subject: [PATCH 31/47] fixing github comment action --- .github/workflows/test-chrome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 0e8fb8a1..39a5ccd5 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -43,7 +43,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | echo: "RUN ID - ${{github.run_id}} and ARTIFACT ID - " - const artifact_url = `https://github.com/${{ github.context.repo.owner }}/${{ github.context.repo.repo }}/actions/runs/${{ github.run_id }}`; + const artifact_url = `https://github.com/${{ context.repo.owner }}/${{ context.repo.repo }}/actions/runs/${{ github.run_id }}`; const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, From 9b231c322259df6b0825cff06e1eb0f088cecfe9 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:16:10 +0530 Subject: [PATCH 32/47] fixing github comment action --- .github/workflows/test-chrome.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 39a5ccd5..d0351e7b 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -41,13 +41,14 @@ jobs: uses: actions/github-script@v5 with: github-token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + repo: ${{ github.event.repository.name }} script: | - echo: "RUN ID - ${{github.run_id}} and ARTIFACT ID - " - const artifact_url = `https://github.com/${{ context.repo.owner }}/${{ context.repo.repo }}/actions/runs/${{ github.run_id }}`; + const artifact_url = `https://github.com/${inputs.owner}/${inputs.repo}/actions/runs/${{ github.run_id }}`; const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, + owner: inputs.owner, + repo: inputs.repo, body: comment_body }); \ No newline at end of file From 1f5b92eda6c06ccd2da81f9c11fd385db3d5ebd7 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:23:52 +0530 Subject: [PATCH 33/47] fixing github comment action --- .github/workflows/test-chrome.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index d0351e7b..e0ee0952 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -41,10 +41,8 @@ jobs: uses: actions/github-script@v5 with: github-token: ${{ secrets.GITHUB_TOKEN }} - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} script: | - const artifact_url = `https://github.com/${inputs.owner}/${inputs.repo}/actions/runs/${{ github.run_id }}`; + const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, From aa51bd81b42b32ca325a71ad25c4c125eedfa1f6 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:31:12 +0530 Subject: [PATCH 34/47] fixing github comment action --- .github/workflows/test-chrome.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index e0ee0952..b9ad1d22 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -46,7 +46,7 @@ jobs: const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, - owner: inputs.owner, - repo: inputs.repo, + owner: context.repo.owner, + repo: context.repo.repo, body: comment_body }); \ No newline at end of file From fb9c223ba007f618274aaf0e60cb201b4ec827ca Mon Sep 17 00:00:00 2001 From: Aatman Vaidya Date: Mon, 18 Sep 2023 23:35:03 +0530 Subject: [PATCH 35/47] test (#7) * test * test * test * test * test * test * test * test * test --- test2.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test2.txt diff --git a/test2.txt b/test2.txt new file mode 100644 index 00000000..8d79a264 --- /dev/null +++ b/test2.txt @@ -0,0 +1,2 @@ +testing testing testing +- test 8 \ No newline at end of file From b26449d6b04a1ba8b9fc6d3654c8623db882bd61 Mon Sep 17 00:00:00 2001 From: Aatman Date: Mon, 18 Sep 2023 23:43:40 +0530 Subject: [PATCH 36/47] fixing github comment action --- .github/workflows/test-chrome.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index b9ad1d22..1f46a36b 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -29,13 +29,12 @@ jobs: pwd npm install npm run build - zip extension.zip ./dist/ -r - name: "Upload extension.zip as artifact" uses: actions/upload-artifact@v3 with: name: extension - path: browser-extension/plugin/extension.zip + path: browser-extension/plugin/dist/ - name: Create PR Comment with Artifact Link uses: actions/github-script@v5 From 8af2beb22c529183613144f4d112931bec9abba0 Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 00:29:24 +0530 Subject: [PATCH 37/47] fixing github comment action --- .github/workflows/test-chrome.yml | 4 +-- .github/workflows/test-firefox.yml | 51 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-firefox.yml diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index 1f46a36b..c4ae19ca 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -1,4 +1,4 @@ -name: "TEST" +name: "PR Extensino for Chrome" on: pull_request: @@ -42,7 +42,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; - const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; + const comment_body = `šŸ›  Your build files for CHROME are available [here](${artifact_url}).`; await github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, owner: context.repo.owner, diff --git a/.github/workflows/test-firefox.yml b/.github/workflows/test-firefox.yml new file mode 100644 index 00000000..196f78e0 --- /dev/null +++ b/.github/workflows/test-firefox.yml @@ -0,0 +1,51 @@ +name: "PR Extensino for Firefox" + +on: + pull_request: + branches: + - actions + +jobs: + firefox-publish: + name: "Pre Release Extension" + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout Development Branch" + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Get commit SHA + shell: bash + run: | + echo "setting variables" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: "Build and Test" + run: | + cd browser-extension/plugin + ls + pwd + npm install + npm run build:firefox + + - name: "Upload extension.zip as artifact" + uses: actions/upload-artifact@v3 + with: + name: extension + path: browser-extension/plugin/dist/ + + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; + const comment_body = `šŸ›  Your build files for FIREFOX are available [here](${artifact_url}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); \ No newline at end of file From 6b45e525fd5f4213cd756f93c4d5d3cde3492127 Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 08:28:45 +0530 Subject: [PATCH 38/47] testing new actions --- .github/workflows/test-both-browsers.yml | 75 ++++++++++++++++++++++++ .github/workflows/test-chrome.yml | 2 +- .github/workflows/test-firefox.yml | 2 +- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-both-browsers.yml diff --git a/.github/workflows/test-both-browsers.yml b/.github/workflows/test-both-browsers.yml new file mode 100644 index 00000000..c0b1de30 --- /dev/null +++ b/.github/workflows/test-both-browsers.yml @@ -0,0 +1,75 @@ +name: "PR Extension for Browsers" + +on: + pull_request: + branches: + - actions + +jobs: + build-and-publish: + name: "Build and Publish Extensions" + runs-on: "ubuntu-latest" + + strategy: + matrix: + browser: + - chrome + - firefox + + steps: + - name: "Checkout Development Branch" + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Get commit SHA + shell: bash + run: | + echo "Setting variables" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: "Build and Test" + run: | + cd browser-extension/plugin + ls + pwd + npm install + npm run build:${{ matrix.browser }} + + - name: "Upload extension.zip as artifact" + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.browser }}-extension + path: browser-extension/plugin/dist/ + + create-pr-comment: + name: "Create PR Comment with Artifact Links" + needs: build-and-publish + runs-on: "ubuntu-latest" + steps: + - name: "Download Chrome and Firefox Artifacts" + uses: actions/download-artifact@v2 + with: + name: chrome-extension + path: browser-extension/chrome + + - name: "Download Firefox Artifacts" + uses: actions/download-artifact@v2 + with: + name: firefox-extension + path: browser-extension/firefox + + - name: Create PR Comment with Artifact Links + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const chromeArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/chrome-extension`; + const firefoxArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/firefox-extension`; + const commentBody = `šŸ›  Your build files for CHROME are available [here](${chromeArtifactUrl}).\nšŸ›  Your build files for FIREFOX are available [here](${firefoxArtifactUrl}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentBody, + }); diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index c4ae19ca..b5990729 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -33,7 +33,7 @@ jobs: - name: "Upload extension.zip as artifact" uses: actions/upload-artifact@v3 with: - name: extension + name: extension-chrome path: browser-extension/plugin/dist/ - name: Create PR Comment with Artifact Link diff --git a/.github/workflows/test-firefox.yml b/.github/workflows/test-firefox.yml index 196f78e0..4e43efc3 100644 --- a/.github/workflows/test-firefox.yml +++ b/.github/workflows/test-firefox.yml @@ -33,7 +33,7 @@ jobs: - name: "Upload extension.zip as artifact" uses: actions/upload-artifact@v3 with: - name: extension + name: extension-firefox path: browser-extension/plugin/dist/ - name: Create PR Comment with Artifact Link From 5cb1a40b7cf7bbb09bd1cdb6b909a475edcf7481 Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 08:31:50 +0530 Subject: [PATCH 39/47] updating actions --- .github/workflows/test-both-browsers.yml | 130 +++++++++++------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/test-both-browsers.yml b/.github/workflows/test-both-browsers.yml index c0b1de30..75ac0717 100644 --- a/.github/workflows/test-both-browsers.yml +++ b/.github/workflows/test-both-browsers.yml @@ -1,75 +1,75 @@ -name: "PR Extension for Browsers" +# name: "PR Extension for Browsers" -on: - pull_request: - branches: - - actions +# on: +# pull_request: +# branches: +# - actions -jobs: - build-and-publish: - name: "Build and Publish Extensions" - runs-on: "ubuntu-latest" +# jobs: +# build-and-publish: +# name: "Build and Publish Extensions" +# runs-on: "ubuntu-latest" - strategy: - matrix: - browser: - - chrome - - firefox +# strategy: +# matrix: +# browser: +# - chrome +# - firefox - steps: - - name: "Checkout Development Branch" - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} +# steps: +# - name: "Checkout Development Branch" +# uses: actions/checkout@v3 +# with: +# ref: ${{ github.event.pull_request.head.ref }} - - name: Get commit SHA - shell: bash - run: | - echo "Setting variables" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" +# - name: Get commit SHA +# shell: bash +# run: | +# echo "Setting variables" +# echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: "Build and Test" - run: | - cd browser-extension/plugin - ls - pwd - npm install - npm run build:${{ matrix.browser }} +# - name: "Build and Test" +# run: | +# cd browser-extension/plugin +# ls +# pwd +# npm install +# npm run build:${{ matrix.browser }} - - name: "Upload extension.zip as artifact" - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.browser }}-extension - path: browser-extension/plugin/dist/ +# - name: "Upload extension.zip as artifact" +# uses: actions/upload-artifact@v3 +# with: +# name: ${{ matrix.browser }}-extension +# path: browser-extension/plugin/dist/ - create-pr-comment: - name: "Create PR Comment with Artifact Links" - needs: build-and-publish - runs-on: "ubuntu-latest" - steps: - - name: "Download Chrome and Firefox Artifacts" - uses: actions/download-artifact@v2 - with: - name: chrome-extension - path: browser-extension/chrome +# create-pr-comment: +# name: "Create PR Comment with Artifact Links" +# needs: build-and-publish +# runs-on: "ubuntu-latest" +# steps: +# - name: "Download Chrome and Firefox Artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: chrome-extension +# path: browser-extension/chrome - - name: "Download Firefox Artifacts" - uses: actions/download-artifact@v2 - with: - name: firefox-extension - path: browser-extension/firefox +# - name: "Download Firefox Artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: firefox-extension +# path: browser-extension/firefox - - name: Create PR Comment with Artifact Links - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const chromeArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/chrome-extension`; - const firefoxArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/firefox-extension`; - const commentBody = `šŸ›  Your build files for CHROME are available [here](${chromeArtifactUrl}).\nšŸ›  Your build files for FIREFOX are available [here](${firefoxArtifactUrl}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: commentBody, - }); +# - name: Create PR Comment with Artifact Links +# uses: actions/github-script@v5 +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# script: | +# const chromeArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/chrome-extension`; +# const firefoxArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/firefox-extension`; +# const commentBody = `šŸ›  Your build files for CHROME are available [here](${chromeArtifactUrl}).\nšŸ›  Your build files for FIREFOX are available [here](${firefoxArtifactUrl}).`; +# await github.rest.issues.createComment({ +# issue_number: context.payload.pull_request.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: commentBody, +# }); \ No newline at end of file From 0a716994dffc345c6fbdcc36b192c92b2c2d8b0c Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 14:36:12 +0530 Subject: [PATCH 40/47] final changes --- .github/workflows/test-both-browsers.yml | 75 ------------------------ .github/workflows/test-chrome.yml | 6 +- .github/workflows/test-firefox.yml | 6 +- test.txt.txt | 2 - test2.txt | 2 - 5 files changed, 6 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/test-both-browsers.yml delete mode 100644 test.txt.txt delete mode 100644 test2.txt diff --git a/.github/workflows/test-both-browsers.yml b/.github/workflows/test-both-browsers.yml deleted file mode 100644 index 75ac0717..00000000 --- a/.github/workflows/test-both-browsers.yml +++ /dev/null @@ -1,75 +0,0 @@ -# name: "PR Extension for Browsers" - -# on: -# pull_request: -# branches: -# - actions - -# jobs: -# build-and-publish: -# name: "Build and Publish Extensions" -# runs-on: "ubuntu-latest" - -# strategy: -# matrix: -# browser: -# - chrome -# - firefox - -# steps: -# - name: "Checkout Development Branch" -# uses: actions/checkout@v3 -# with: -# ref: ${{ github.event.pull_request.head.ref }} - -# - name: Get commit SHA -# shell: bash -# run: | -# echo "Setting variables" -# echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - -# - name: "Build and Test" -# run: | -# cd browser-extension/plugin -# ls -# pwd -# npm install -# npm run build:${{ matrix.browser }} - -# - name: "Upload extension.zip as artifact" -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ matrix.browser }}-extension -# path: browser-extension/plugin/dist/ - -# create-pr-comment: -# name: "Create PR Comment with Artifact Links" -# needs: build-and-publish -# runs-on: "ubuntu-latest" -# steps: -# - name: "Download Chrome and Firefox Artifacts" -# uses: actions/download-artifact@v2 -# with: -# name: chrome-extension -# path: browser-extension/chrome - -# - name: "Download Firefox Artifacts" -# uses: actions/download-artifact@v2 -# with: -# name: firefox-extension -# path: browser-extension/firefox - -# - name: Create PR Comment with Artifact Links -# uses: actions/github-script@v5 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# script: | -# const chromeArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/chrome-extension`; -# const firefoxArtifactUrl = `https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}/artifacts/firefox-extension`; -# const commentBody = `šŸ›  Your build files for CHROME are available [here](${chromeArtifactUrl}).\nšŸ›  Your build files for FIREFOX are available [here](${firefoxArtifactUrl}).`; -# await github.rest.issues.createComment({ -# issue_number: context.payload.pull_request.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: commentBody, -# }); \ No newline at end of file diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/test-chrome.yml index b5990729..cc2e76de 100644 --- a/.github/workflows/test-chrome.yml +++ b/.github/workflows/test-chrome.yml @@ -1,13 +1,13 @@ -name: "PR Extensino for Chrome" +name: "Build For PR Review - Chrome" on: pull_request: branches: - - actions + - main jobs: chrome-publish: - name: "Pre Release Extension" + name: "Build For PR Review" runs-on: "ubuntu-latest" steps: diff --git a/.github/workflows/test-firefox.yml b/.github/workflows/test-firefox.yml index 4e43efc3..095d92d1 100644 --- a/.github/workflows/test-firefox.yml +++ b/.github/workflows/test-firefox.yml @@ -1,13 +1,13 @@ -name: "PR Extensino for Firefox" +name: "Build For PR Review - Firefox" on: pull_request: branches: - - actions + - main jobs: firefox-publish: - name: "Pre Release Extension" + name: "Build For PR Review" runs-on: "ubuntu-latest" steps: diff --git a/test.txt.txt b/test.txt.txt deleted file mode 100644 index 529883d3..00000000 --- a/test.txt.txt +++ /dev/null @@ -1,2 +0,0 @@ -testing github actions -- test 15 diff --git a/test2.txt b/test2.txt deleted file mode 100644 index 8d79a264..00000000 --- a/test2.txt +++ /dev/null @@ -1,2 +0,0 @@ -testing testing testing -- test 8 \ No newline at end of file From afc362f9503946761c89e11ba06003197c211132 Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 14:38:14 +0530 Subject: [PATCH 41/47] changing file names --- ...t-chrome.yml => build-pr-review-chrome.yml} | 0 ...firefox.yml => build-pr-review-firefox.yml} | 0 .github/workflows/test.yml | 18 ------------------ 3 files changed, 18 deletions(-) rename .github/workflows/{test-chrome.yml => build-pr-review-chrome.yml} (100%) rename .github/workflows/{test-firefox.yml => build-pr-review-firefox.yml} (100%) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test-chrome.yml b/.github/workflows/build-pr-review-chrome.yml similarity index 100% rename from .github/workflows/test-chrome.yml rename to .github/workflows/build-pr-review-chrome.yml diff --git a/.github/workflows/test-firefox.yml b/.github/workflows/build-pr-review-firefox.yml similarity index 100% rename from .github/workflows/test-firefox.yml rename to .github/workflows/build-pr-review-firefox.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8a9c1ffd..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions šŸš€ -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "šŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "šŸ§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "šŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "šŸ’” The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "šŸ–„ļø The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "šŸ This job's status is ${{ job.status }}." \ No newline at end of file From 55233d7c7cbc27a0c4b60dd5439889ba3b07408c Mon Sep 17 00:00:00 2001 From: Aatman Date: Tue, 19 Sep 2023 22:51:50 +0530 Subject: [PATCH 42/47] github action build pr review for both the browsers --- .../build-pr-review-both-browsers.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build-pr-review-both-browsers.yml diff --git a/.github/workflows/build-pr-review-both-browsers.yml b/.github/workflows/build-pr-review-both-browsers.yml new file mode 100644 index 00000000..43b9c6b7 --- /dev/null +++ b/.github/workflows/build-pr-review-both-browsers.yml @@ -0,0 +1,54 @@ +name: "Build For PR Review - Both Browsers" + +on: + pull_request: + branches: + - main + +jobs: + chrome-publish: + name: "Build For PR Review" + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout Development Branch" + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Get commit SHA + shell: bash + run: | + echo "setting variables" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - name: "Build and Test" + run: | + cd browser-extension/plugin + ls + pwd + npm install + npm run build + mv dist/ extension-chrome/ + npm run build:firefox + mv dist/ extension-firefox/ + - name: "Upload dist folder as artifact" + uses: actions/upload-artifact@v3 + with: + name: extension-artifcats + path: | + browser-extension/plugin/extension-firefox/ + browser-extension/plugin/extension-chrome/ + + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; + const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); \ No newline at end of file From cbab66395149e312eefe83b84bc142c7860d4def Mon Sep 17 00:00:00 2001 From: Aatman Date: Wed, 20 Sep 2023 10:35:57 +0530 Subject: [PATCH 43/47] action checkout change --- .github/workflows/build-pr-review-both-browsers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-pr-review-both-browsers.yml b/.github/workflows/build-pr-review-both-browsers.yml index 43b9c6b7..522f75c3 100644 --- a/.github/workflows/build-pr-review-both-browsers.yml +++ b/.github/workflows/build-pr-review-both-browsers.yml @@ -12,9 +12,9 @@ jobs: steps: - name: "Checkout Development Branch" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.ref }} + ref: ${{ github.event.pull_request.head.sha }} - name: Get commit SHA shell: bash From aaf2cd5e5277d55c0ad7e873fdb2b97c0de3b751 Mon Sep 17 00:00:00 2001 From: Aatman Date: Wed, 20 Sep 2023 12:05:04 +0530 Subject: [PATCH 44/47] checking GITHUB_TOKEN --- .../build-pr-review-both-browsers.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-pr-review-both-browsers.yml b/.github/workflows/build-pr-review-both-browsers.yml index 522f75c3..32276582 100644 --- a/.github/workflows/build-pr-review-both-browsers.yml +++ b/.github/workflows/build-pr-review-both-browsers.yml @@ -43,12 +43,13 @@ jobs: uses: actions/github-script@v5 with: github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; - const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); \ No newline at end of file + run: echo $GITHUB_TOKEN + # script: | + # const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; + # const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; + # await github.rest.issues.createComment({ + # issue_number: context.payload.pull_request.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: comment_body + # }); \ No newline at end of file From 87e1b88cd027a82edd1822c4165aaa16890e6140 Mon Sep 17 00:00:00 2001 From: Aatman Date: Wed, 20 Sep 2023 12:08:50 +0530 Subject: [PATCH 45/47] checking GITHUB_TOKEN --- .../workflows/build-pr-review-both-browsers.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pr-review-both-browsers.yml b/.github/workflows/build-pr-review-both-browsers.yml index 32276582..0f04ab83 100644 --- a/.github/workflows/build-pr-review-both-browsers.yml +++ b/.github/workflows/build-pr-review-both-browsers.yml @@ -38,12 +38,16 @@ jobs: path: | browser-extension/plugin/extension-firefox/ browser-extension/plugin/extension-chrome/ + + - name: Echo GitHub Token + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: echo $GITHUB_TOKEN - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - run: echo $GITHUB_TOKEN + # - name: Create PR Comment with Artifact Link + # uses: actions/github-script@v5 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} # script: | # const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; # const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; From 744ee4c15d08d9206cfbe81bc0202ea3573df183 Mon Sep 17 00:00:00 2001 From: Aatman Date: Wed, 20 Sep 2023 12:39:22 +0530 Subject: [PATCH 46/47] deleting chrome and firefox seperate github action files for build PR review --- .github/workflows/build-pr-review-chrome.yml | 51 ------------------- .github/workflows/build-pr-review-firefox.yml | 51 ------------------- 2 files changed, 102 deletions(-) delete mode 100644 .github/workflows/build-pr-review-chrome.yml delete mode 100644 .github/workflows/build-pr-review-firefox.yml diff --git a/.github/workflows/build-pr-review-chrome.yml b/.github/workflows/build-pr-review-chrome.yml deleted file mode 100644 index cc2e76de..00000000 --- a/.github/workflows/build-pr-review-chrome.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "Build For PR Review - Chrome" - -on: - pull_request: - branches: - - main - -jobs: - chrome-publish: - name: "Build For PR Review" - runs-on: "ubuntu-latest" - - steps: - - name: "Checkout Development Branch" - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Get commit SHA - shell: bash - run: | - echo "setting variables" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: "Build and Test" - run: | - cd browser-extension/plugin - ls - pwd - npm install - npm run build - - - name: "Upload extension.zip as artifact" - uses: actions/upload-artifact@v3 - with: - name: extension-chrome - path: browser-extension/plugin/dist/ - - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; - const comment_body = `šŸ›  Your build files for CHROME are available [here](${artifact_url}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); \ No newline at end of file diff --git a/.github/workflows/build-pr-review-firefox.yml b/.github/workflows/build-pr-review-firefox.yml deleted file mode 100644 index 095d92d1..00000000 --- a/.github/workflows/build-pr-review-firefox.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "Build For PR Review - Firefox" - -on: - pull_request: - branches: - - main - -jobs: - firefox-publish: - name: "Build For PR Review" - runs-on: "ubuntu-latest" - - steps: - - name: "Checkout Development Branch" - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Get commit SHA - shell: bash - run: | - echo "setting variables" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: "Build and Test" - run: | - cd browser-extension/plugin - ls - pwd - npm install - npm run build:firefox - - - name: "Upload extension.zip as artifact" - uses: actions/upload-artifact@v3 - with: - name: extension-firefox - path: browser-extension/plugin/dist/ - - - name: Create PR Comment with Artifact Link - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; - const comment_body = `šŸ›  Your build files for FIREFOX are available [here](${artifact_url}).`; - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body - }); \ No newline at end of file From 34e1a20f551a7bb27ff3982c8e114dbea7c86434 Mon Sep 17 00:00:00 2001 From: Aatman Date: Wed, 20 Sep 2023 12:40:54 +0530 Subject: [PATCH 47/47] fixes --- .../build-pr-review-both-browsers.yml | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-pr-review-both-browsers.yml b/.github/workflows/build-pr-review-both-browsers.yml index 0f04ab83..522f75c3 100644 --- a/.github/workflows/build-pr-review-both-browsers.yml +++ b/.github/workflows/build-pr-review-both-browsers.yml @@ -38,22 +38,17 @@ jobs: path: | browser-extension/plugin/extension-firefox/ browser-extension/plugin/extension-chrome/ - - - name: Echo GitHub Token - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: echo $GITHUB_TOKEN - # - name: Create PR Comment with Artifact Link - # uses: actions/github-script@v5 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # script: | - # const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; - # const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; - # await github.rest.issues.createComment({ - # issue_number: context.payload.pull_request.number, - # owner: context.repo.owner, - # repo: context.repo.repo, - # body: comment_body - # }); \ No newline at end of file + - name: Create PR Comment with Artifact Link + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`; + const comment_body = `šŸ›  Your build files are available [here](${artifact_url}).`; + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }); \ No newline at end of file