From 93b43846c646e4576ad38392c4bbab0ab0f553ed Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 23 Sep 2024 13:11:57 -0400 Subject: [PATCH 01/16] Add comment script --- .../github-actions-release-candidate.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-release-candidate.yml b/.github/workflows/github-actions-release-candidate.yml index 1e1f6872d4..e3a32610b7 100644 --- a/.github/workflows/github-actions-release-candidate.yml +++ b/.github/workflows/github-actions-release-candidate.yml @@ -102,4 +102,17 @@ jobs: gh release create v${{ env.new_npm_version }} \ --title "Release Candidate v${{ env.new_npm_version }}" \ --notes "This is a release candidate version. Please test thoroughly before promoting to a stable release." \ - --prerelease \ No newline at end of file + --prerelease + - name: Leave PR comment + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUBY_GEM_VERSION: ${{ env.new_ruby_version }} + RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} + NPM_VERSION: ${{ env.new_npm_version }} + NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} + run: | + curl -H "Authorization: token ${GITHUB_TOKEN}" \ + -X POST \ + -d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" From 2eea34f12b679d65b73aec58aee1c567a34649fc Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:28:29 -0400 Subject: [PATCH 02/16] find pr number a different way --- .../workflows/github-actions-comment-test.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/github-actions-comment-test.yml diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml new file mode 100644 index 0000000000..327fd2e455 --- /dev/null +++ b/.github/workflows/github-actions-comment-test.yml @@ -0,0 +1,29 @@ +name: Comment on Push better + +on: + pull_request: + types: [opened, synchronize] + +jobs: + add-comment: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Get Pull Request Number + id: pr + run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Leave PR comment + env: + PR_NUMBER: ${{ steps.pr.outputs.pull_request_number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + run: | + curl -H "Authorization: token ${GITHUB_TOKEN}" \ + -X POST \ + -d '{"body": "🎉 Congratulations "}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" From 6033835fe5f208b4716e7011f99ee9964f7a0f7b Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:33:50 -0400 Subject: [PATCH 03/16] try a different way --- .../workflows/github-actions-comment-test.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 327fd2e455..227f3a779b 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -11,15 +11,17 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Get Pull Request Number - id: pr - run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Test + uses: actions/github-script@0.3.0 + with: + github-token: ${{github.token}} + script: | + const core = require('@actions/core') + const prNumber = context.payload.number; + core.exportVariable('PULL_NUMBER', prNumber); - name: Leave PR comment env: - PR_NUMBER: ${{ steps.pr.outputs.pull_request_number }} + PR_NUMBER: ${{ PULL_NUMBER }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From c3c43e1409d151a29fe2c576f4f720715f23522b Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:36:09 -0400 Subject: [PATCH 04/16] it didnt run --- .github/workflows/github-actions-comment-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 227f3a779b..dc5eaa0901 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -14,7 +14,7 @@ jobs: - name: Test uses: actions/github-script@0.3.0 with: - github-token: ${{github.token}} + github-token: ${{secrets.GITHUB_TOKEN}} script: | const core = require('@actions/core') const prNumber = context.payload.number; From 573639e0919abf538ddae6d1df77a8270445c8d6 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:42:38 -0400 Subject: [PATCH 05/16] Try even harder --- .../workflows/github-actions-comment-test.yml | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index dc5eaa0901..e1da1a1ec9 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -13,17 +13,29 @@ jobs: uses: actions/checkout@v3 - name: Test uses: actions/github-script@0.3.0 + id: get_issue_number with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const core = require('@actions/core') - const prNumber = context.payload.number; - core.exportVariable('PULL_NUMBER', prNumber); + script: | + if (context.issue.number) { + // Return issue number if present + return context.issue.number; + } else { + // Otherwise return issue number from commit + return ( + await github.rest.repos.listPullRequestsAssociatedWithCommit({ + commit_sha: context.sha, + owner: context.repo.owner, + repo: context.repo.repo, + }) + ).data[0].number; + } + result-encoding: string + - name: Issue number + run: echo '${{steps.get_issue_number.outputs.result}}' - name: Leave PR comment env: - PR_NUMBER: ${{ PULL_NUMBER }} + PR_NUMBER: ${{ steps.get_issue_number.outputs.result }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | curl -H "Authorization: token ${GITHUB_TOKEN}" \ -X POST \ From 2f9fa990245d1e166c4a72d4bc73e7074cc48913 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:46:31 -0400 Subject: [PATCH 06/16] Try v 7 --- .../workflows/github-actions-comment-test.yml | 42 ++++--------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index e1da1a1ec9..927e2c11bd 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -5,39 +5,15 @@ on: types: [opened, synchronize] jobs: - add-comment: + comment: runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Test - uses: actions/github-script@0.3.0 - id: get_issue_number + - uses: actions/github-script@v7 with: - script: | - if (context.issue.number) { - // Return issue number if present - return context.issue.number; - } else { - // Otherwise return issue number from commit - return ( - await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }) - ).data[0].number; - } - result-encoding: string - - name: Issue number - run: echo '${{steps.get_issue_number.outputs.result}}' - - name: Leave PR comment - env: - PR_NUMBER: ${{ steps.get_issue_number.outputs.result }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - curl -H "Authorization: token ${GITHUB_TOKEN}" \ - -X POST \ - -d '{"body": "🎉 Congratulations "}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Context test' + }) From 232e07ca59edd186719b270ebe727848336dd8f7 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 10:52:50 -0400 Subject: [PATCH 07/16] more comments --- .../workflows/github-actions-comment-test.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 927e2c11bd..f2b84733cb 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -8,6 +8,19 @@ jobs: comment: runs-on: ubuntu-latest steps: + - name: Leave PR comment + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUBY_GEM_VERSION: '123' + RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} + NPM_VERSION: '456' + NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} + run: | + curl -H "Authorization: token ${GITHUB_TOKEN}" \ + -X POST \ + -d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" - uses: actions/github-script@v7 with: script: | @@ -15,5 +28,8 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Context test' + body: "Authorization: token ${PR_NUMBER]}" }) + + + From bd4089e313400400164c062c6392f820d627e173 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:02:12 -0400 Subject: [PATCH 08/16] interperlate better --- .github/workflows/github-actions-comment-test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index f2b84733cb..b905c6bfb1 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -21,14 +21,17 @@ jobs: -X POST \ -d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" - - uses: actions/github-script@v7 + - name: comment-two + uses: actions/github-script@v7 + env: + RUBY_GEM_LINK: ${{env.RUBY_GEM_LINK}} with: script: | github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Authorization: token ${PR_NUMBER]}" + body: `Here is the link to your Ruby Gem: ${process.env.RUBY_GEM_LINK}` }) From e08280e35e77e0fc578242fd1840e1572970239c Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:07:04 -0400 Subject: [PATCH 09/16] Learn how to env --- .github/workflows/github-actions-comment-test.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index b905c6bfb1..d265e3841e 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -13,9 +13,9 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RUBY_GEM_VERSION: '123' - RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} + RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.RUBY_GEM_VERSION}} NPM_VERSION: '456' - NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} + NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.NPM_VERSION}} run: | curl -H "Authorization: token ${GITHUB_TOKEN}" \ -X POST \ @@ -23,15 +23,13 @@ jobs: "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" - name: comment-two uses: actions/github-script@v7 - env: - RUBY_GEM_LINK: ${{env.RUBY_GEM_LINK}} with: script: | github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Here is the link to your Ruby Gem: ${process.env.RUBY_GEM_LINK}` + body: 'Here is the link to your Ruby Gem: ${env.RUBY_GEM_VERSION}' }) From 2e9dbaa444b5c7d2f232f09d15e0a0dc2b7090c2 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:11:21 -0400 Subject: [PATCH 10/16] how to call a variable --- .github/workflows/github-actions-comment-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index d265e3841e..eb518a7c08 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -29,7 +29,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Here is the link to your Ruby Gem: ${env.RUBY_GEM_VERSION}' + body: `Here is the link to your Ruby Gem: ${process.env.RUBY_GEM_VERSION}` }) From 98ded0a47090af75ee2900dfa191d4c64b6a6d12 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:15:21 -0400 Subject: [PATCH 11/16] use double curly --- .github/workflows/github-actions-comment-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index eb518a7c08..d50e157342 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -29,7 +29,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Here is the link to your Ruby Gem: ${process.env.RUBY_GEM_VERSION}` + body: "Here is the link to your Ruby Gem: ${{env.RUBY_GEM_VERSION}}" }) From 5e96c483b0113b75918e0b75bee71b4e6878cb3e Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:22:48 -0400 Subject: [PATCH 12/16] env variables are hard to call --- .github/workflows/github-actions-comment-test.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index d50e157342..7b336602d0 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -8,14 +8,18 @@ jobs: comment: runs-on: ubuntu-latest steps: + - name: set versions + run: | + new_ruby_version="123" + new_npm_version="456" - name: Leave PR comment env: PR_NUMBER: ${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUBY_GEM_VERSION: '123' - RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.RUBY_GEM_VERSION}} - NPM_VERSION: '456' - NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.NPM_VERSION}} + RUBY_GEM_VERSION: ${{ env.new_ruby_version }} + RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} + NPM_VERSION: ${{ env.new_npm_version }} + NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} run: | curl -H "Authorization: token ${GITHUB_TOKEN}" \ -X POST \ @@ -29,7 +33,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Here is the link to your Ruby Gem: ${{env.RUBY_GEM_VERSION}}" + body: "Here is the link to your Ruby Gem: ${{env.new_ruby_version}} " }) From 531d7ff010a8845fdef0dc7b52719fce4476b91f Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:32:31 -0400 Subject: [PATCH 13/16] var teset --- .../workflows/github-actions-comment-test.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 7b336602d0..32fbdc9714 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -8,18 +8,14 @@ jobs: comment: runs-on: ubuntu-latest steps: - - name: set versions - run: | - new_ruby_version="123" - new_npm_version="456" - name: Leave PR comment env: PR_NUMBER: ${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUBY_GEM_VERSION: ${{ env.new_ruby_version }} - RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} - NPM_VERSION: ${{ env.new_npm_version }} - NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} + RUBY_GEM_VERSION: '123' + RUBY_GEM_LINK: "https://rubygems.org/gems/playbook_ui/versions/${{env.RUBY_GEM_VERSION}}" + NPM_VERSION: '456' + NPM_LINK: "https://www.npmjs.com/package/playbook-ui/v/${{env.NPM_VERSION}}" run: | curl -H "Authorization: token ${GITHUB_TOKEN}" \ -X POST \ @@ -27,13 +23,15 @@ jobs: "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" - name: comment-two uses: actions/github-script@v7 + env: + AVAR: '789' with: script: | github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Here is the link to your Ruby Gem: ${{env.new_ruby_version}} " + body: "Here is the link ${{ env.AVAR }} to your Ruby Gem: ${{env.RUBY_GEM_VERSION}}" }) From a271278b4341b96be394741539ba3be63fae4760 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:38:12 -0400 Subject: [PATCH 14/16] context test on v3 --- .github/workflows/github-actions-comment-test.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 32fbdc9714..00a2a2356a 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -8,21 +8,8 @@ jobs: comment: runs-on: ubuntu-latest steps: - - name: Leave PR comment - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUBY_GEM_VERSION: '123' - RUBY_GEM_LINK: "https://rubygems.org/gems/playbook_ui/versions/${{env.RUBY_GEM_VERSION}}" - NPM_VERSION: '456' - NPM_LINK: "https://www.npmjs.com/package/playbook-ui/v/${{env.NPM_VERSION}}" - run: | - curl -H "Authorization: token ${GITHUB_TOKEN}" \ - -X POST \ - -d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" - name: comment-two - uses: actions/github-script@v7 + uses: actions/checkout@v3 env: AVAR: '789' with: From c0ed6b445f5fd0fbc43bb19d50cfa3cbdca2b8f2 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:40:02 -0400 Subject: [PATCH 15/16] use newer version --- .github/workflows/github-actions-comment-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml index 00a2a2356a..86ffad82bf 100644 --- a/.github/workflows/github-actions-comment-test.yml +++ b/.github/workflows/github-actions-comment-test.yml @@ -8,8 +8,8 @@ jobs: comment: runs-on: ubuntu-latest steps: - - name: comment-two - uses: actions/checkout@v3 + - name: Leave PR comment + uses: actions/github-script@v7 env: AVAR: '789' with: From ab1ed6c525a1c601031f88fc62765fd878ab5d1e Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 24 Sep 2024 11:47:48 -0400 Subject: [PATCH 16/16] Use new version of script to make comment --- .../workflows/github-actions-comment-test.yml | 25 ------------------- .../github-actions-release-candidate.yml | 14 +++++++---- 2 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/github-actions-comment-test.yml diff --git a/.github/workflows/github-actions-comment-test.yml b/.github/workflows/github-actions-comment-test.yml deleted file mode 100644 index 86ffad82bf..0000000000 --- a/.github/workflows/github-actions-comment-test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Comment on Push better - -on: - pull_request: - types: [opened, synchronize] - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - name: Leave PR comment - uses: actions/github-script@v7 - env: - AVAR: '789' - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Here is the link ${{ env.AVAR }} to your Ruby Gem: ${{env.RUBY_GEM_VERSION}}" - }) - - - diff --git a/.github/workflows/github-actions-release-candidate.yml b/.github/workflows/github-actions-release-candidate.yml index e3a32610b7..b094ac59fb 100644 --- a/.github/workflows/github-actions-release-candidate.yml +++ b/.github/workflows/github-actions-release-candidate.yml @@ -104,6 +104,7 @@ jobs: --notes "This is a release candidate version. Please test thoroughly before promoting to a stable release." \ --prerelease - name: Leave PR comment + uses: actions/github-script@v7 env: PR_NUMBER: ${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -111,8 +112,11 @@ jobs: RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}} NPM_VERSION: ${{ env.new_npm_version }} NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}} - run: | - curl -H "Authorization: token ${GITHUB_TOKEN}" \ - -X POST \ - -d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}})" + })