From 312085edc9f03749233ec2d653f676fc34b349fa Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 14:14:16 +0530 Subject: [PATCH 01/17] Update ci.yml to add success status --- .github/workflows/ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed3bc8f..c418f55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,4 +21,22 @@ jobs: - run: npm run build-library - name: test run: npm run test:ci - \ No newline at end of file + + success_status: + needs: build + runs-on: ubuntu-latest + if: success() # Runs only if the previous jobs are successful + steps: + - name: Set GitHub commit status to success + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state: 'success', + description: 'CI passed', + context: 'CI build status' + }) From f10cd2e1df62e9af7fb718dae55d9ea49acc9c5e Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 14:17:11 +0530 Subject: [PATCH 02/17] Update ci.yml --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c418f55..6c1f291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,18 +25,18 @@ jobs: success_status: needs: build runs-on: ubuntu-latest - if: success() # Runs only if the previous jobs are successful + if: success() steps: - name: Set GitHub commit status to success uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.repos.createCommitStatus({ + await github.repos.createStatus({ owner: context.repo.owner, repo: context.repo.repo, sha: context.sha, state: 'success', - description: 'CI passed', - context: 'CI build status' + description: 'CI passed successfully', + context: 'CI build' }) From adcc11b1158e292fd8e90853944ae7365343d137 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:29:23 +0530 Subject: [PATCH 03/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c1f291..c0c98f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.repos.createStatus({ + await octokit.repos.createStatus({ owner: context.repo.owner, repo: context.repo.repo, sha: context.sha, From 4aaf5f63a5e795d5b59d7b5ef832069da25b56f3 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:33:33 +0530 Subject: [PATCH 04/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0c98f5..ab5d27c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await octokit.repos.createStatus({ + await github.rest.repos.createStatus({ owner: context.repo.owner, repo: context.repo.repo, sha: context.sha, From 65ac307e9f90ab45b491f1b942de516b14256460 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:35:40 +0530 Subject: [PATCH 05/17] Update ci.yml --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab5d27c..b827a26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - run: npm ci - name: lint run: npm run lint - - run: npm run build-library - name: test run: npm run test:ci @@ -32,7 +31,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.rest.repos.createStatus({ + await github.rest.actions.createStatus({ owner: context.repo.owner, repo: context.repo.repo, sha: context.sha, From ff2e236bbcd053f1b433375eb5e0b3437ba60775 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:39:29 +0530 Subject: [PATCH 06/17] Update ci.yml --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b827a26..efe0500 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,12 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.rest.actions.createStatus({ - owner: context.repo.owner, - repo: context.repo.repo, + const { repo, owner } = context.repo; + await github.rest.repos.createStatus({ + owner, + repo, sha: context.sha, state: 'success', description: 'CI passed successfully', context: 'CI build' - }) + }); From 1d5ab597833bb7f3712dc001eb4f88f5c873b353 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:54:12 +0530 Subject: [PATCH 07/17] Update ci.yml --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efe0500..ee1c67b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,6 @@ jobs: node-version: 18 cache: 'npm' - run: npm ci - - name: lint - run: npm run lint - - name: test - run: npm run test:ci - success_status: needs: build runs-on: ubuntu-latest From 756fa92f58f2aaa39fdfe7913b159019984ab0c9 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 16:55:50 +0530 Subject: [PATCH 08/17] Update ci.yml --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee1c67b..65c8f94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: node-version: 18 cache: 'npm' - run: npm ci + - name: lint + + success_status: needs: build runs-on: ubuntu-latest @@ -26,12 +29,14 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const { repo, owner } = context.repo; - await github.rest.repos.createStatus({ + const { owner, repo } = context.repo; + const sha = context.sha; + + await github.repos.createCommitStatus({ owner, repo, - sha: context.sha, + sha, state: 'success', description: 'CI passed successfully', - context: 'CI build' + context: 'CI build', }); From 2f9bb5836d66deb3dc3c9bf046edb8450ea732c7 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:03:36 +0530 Subject: [PATCH 09/17] Update ci.yml --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65c8f94..f287a50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,15 @@ jobs: cache: 'npm' - run: npm ci - name: lint - + run: npm run lint + - run: npm run build-library + - name: test + run: npm run test:ci success_status: needs: build runs-on: ubuntu-latest - if: success() + if: success() # this makes sure it only runs if the build succeeded steps: - name: Set GitHub commit status to success uses: actions/github-script@v6 @@ -32,6 +35,8 @@ jobs: const { owner, repo } = context.repo; const sha = context.sha; + console.log("Setting commit status to success for SHA: ", sha); + await github.repos.createCommitStatus({ owner, repo, From fb6e35050bb9e7e154ce6f6f86352b8eaf3d3afc Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:06:19 +0530 Subject: [PATCH 10/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f287a50..d6a9477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: console.log("Setting commit status to success for SHA: ", sha); - await github.repos.createCommitStatus({ + await github.rest.repos.createStatus({ owner, repo, sha, From b02778b81859554e5c17250cfb4d81e0b7dab4a5 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:10:14 +0530 Subject: [PATCH 11/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6a9477..7b70f6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: console.log("Setting commit status to success for SHA: ", sha); - await github.rest.repos.createStatus({ + await github.rest.repos.createCommitStatus({ owner, repo, sha, From d6cd2a8a1af3609da94cd8cf9f8c28acd8fd9b1a Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:12:42 +0530 Subject: [PATCH 12/17] Update ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b70f6d..0d7358b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - run: npm ci - name: lint run: npm run lint - - run: npm run build-library - name: test run: npm run test:ci From f1fee425b39128f6a4cddd1e721ee0983ba30cca Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:16:11 +0530 Subject: [PATCH 13/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d7358b..9b13ec1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,5 +42,5 @@ jobs: sha, state: 'success', description: 'CI passed successfully', - context: 'CI build', + context: 'CI Should pass', }); From fe2c2c6badcdf66f41a804c631b445c588aaf871 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:18:51 +0530 Subject: [PATCH 14/17] Update ci.yml --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b13ec1..7430b21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,14 +33,11 @@ jobs: script: | const { owner, repo } = context.repo; const sha = context.sha; - - console.log("Setting commit status to success for SHA: ", sha); - await github.rest.repos.createCommitStatus({ owner, repo, sha, state: 'success', description: 'CI passed successfully', - context: 'CI Should pass', + context: 'CI', }); From 85c66b83df1000a886d0203ac00d058b73d04c7f Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:23:28 +0530 Subject: [PATCH 15/17] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7430b21..fc0e392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: success_status: needs: build runs-on: ubuntu-latest - if: success() # this makes sure it only runs if the build succeeded + if: success() steps: - name: Set GitHub commit status to success uses: actions/github-script@v6 From 13f80dbf1fe2d590a372eda5838cf9c9ac03c2d7 Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:26:25 +0530 Subject: [PATCH 16/17] Update ci.yml --- .github/workflows/ci.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0e392..c00a1e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,24 +20,3 @@ jobs: run: npm run lint - name: test run: npm run test:ci - - success_status: - needs: build - runs-on: ubuntu-latest - if: success() - steps: - - name: Set GitHub commit status to success - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { owner, repo } = context.repo; - const sha = context.sha; - await github.rest.repos.createCommitStatus({ - owner, - repo, - sha, - state: 'success', - description: 'CI passed successfully', - context: 'CI', - }); From 3555e19f194f81f5906158f6809c28a5de69c2ab Mon Sep 17 00:00:00 2001 From: Gaurav bhojwani Date: Sat, 28 Sep 2024 17:29:04 +0530 Subject: [PATCH 17/17] Update ci.yml --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c00a1e1..59e4809 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,25 @@ jobs: run: npm run lint - name: test run: npm run test:ci + success_status: + needs: build + runs-on: ubuntu-latest + if: success() + steps: + - name: Set GitHub commit status to success + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { owner, repo } = context.repo; + const sha = context.sha; + await github.rest.repos.createCommitStatus({ + owner, + repo, + sha, + state: 'success', + description: 'CI passed successfully', + context: 'CI', + }); + +