From 19700d49ca01a73d1e11558ace29340f11ea3cf8 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Thu, 28 Mar 2024 10:59:51 -0400 Subject: [PATCH] update ghascript usage --- .github/workflows/manual-test.yml | 6 ++++-- .github/workflows/pr-test.yml | 6 ++++-- README.md | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual-test.yml b/.github/workflows/manual-test.yml index 84e2f1c..4b67cf5 100644 --- a/.github/workflows/manual-test.yml +++ b/.github/workflows/manual-test.yml @@ -35,9 +35,10 @@ jobs: echo "STUB ISSUE NUMBER: ${{steps.test_action.outputs.stub_issue_number}}" - name: Comment on transferred issue if: steps.test_action.outputs.new_issue_number != '' - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: debug: true + github-token: ${{ secrets.TRANSFER_ISSUE_TOKEN }} script: | try { await github.rest.issues.createComment({ @@ -51,9 +52,10 @@ jobs: } - name: Close transferred issue if: steps.test_action.outputs.new_issue_number != '' - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: debug: true + github-token: ${{ secrets.TRANSFER_ISSUE_TOKEN }} script: | try { await github.rest.issues.update({ diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 1811d76..45f2997 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -51,9 +51,10 @@ jobs: echo "NEW ISSUE URL: ${{steps.test_action.outputs.new_issue_url}}" echo "STUB ISSUE NUMBER: ${{steps.test_action.outputs.stub_issue_number}}" - name: Comment on test issue - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: debug: true + github-token: ${{ secrets.TRANSFER_ISSUE_TOKEN }} script: | try { await github.rest.issues.createComment({ @@ -66,9 +67,10 @@ jobs: core.setFailed(error.message); } - name: Close test issue for cleanliness purposes - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: debug: true + github-token: ${{ secrets.TRANSFER_ISSUE_TOKEN }} script: | try { await github.rest.issues.update({ diff --git a/README.md b/README.md index 0c2fd5d..7adbb19 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Input | Description | Required | Default | ### Input Notes -* The `GITHUB_TOKEN` secret provided by GitHub Actions will not work when transferring issues to another repo. You will get the error `Resource not accessible by integration` if you try and use it. Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the repo check box and all its sub items checked. +* The `GITHUB_TOKEN` secret provided by GitHub Actions will not work when transferring issues to another repo. You will get the error `Resource not accessible by integration` if you try and use it. Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the `repo` check box and all its sub items checked. ## Outputs