Chore: use GITHUB_TOKEN in breaking changes workflow instead of grot … (#72438)

Chore: use GITHUB_TOKEN in breaking changes workflow instead of grot token
pull/72487/head
Josh Hunt 2 years ago committed by GitHub
parent f63d829bf6
commit 70c05fff57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      .github/workflows/detect-breaking-changes-report.yml

@ -5,6 +5,9 @@ on:
workflows: ["Levitate / Detect breaking changes"] workflows: ["Levitate / Detect breaking changes"]
types: [completed] types: [completed]
permissions:
pull-requests: write
jobs: jobs:
notify: notify:
name: Report name: Report
@ -35,7 +38,7 @@ jobs:
run_id: runId, run_id: runId,
}); });
const artifact = artifacts.data.artifacts.find(a => a.name === artifactName); const artifact = artifacts.data.artifacts.find(a => a.name === artifactName);
if (!artifact) { if (!artifact) {
throw new Error(`Could not find artifact ${ artifactName } in workflow (${ runId })`); throw new Error(`Could not find artifact ${ artifactName } in workflow (${ runId })`);
} }
@ -49,11 +52,11 @@ jobs:
fs.mkdirSync(artifactFolder, { recursive: true }); fs.mkdirSync(artifactFolder, { recursive: true });
fs.writeFileSync(`${ artifactFolder }/${ artifactName }.zip`, Buffer.from(download.data)); fs.writeFileSync(`${ artifactFolder }/${ artifactName }.zip`, Buffer.from(download.data));
# Unzip artifact # Unzip artifact
- name: Unzip artifact - name: Unzip artifact
run: unzip "${ARTIFACT_FOLDER}/${ARTIFACT_NAME}.zip" -d "${ARTIFACT_FOLDER}" run: unzip "${ARTIFACT_FOLDER}/${ARTIFACT_NAME}.zip" -d "${ARTIFACT_FOLDER}"
# Parse the artifact and register fields as step output variables # Parse the artifact and register fields as step output variables
# (All fields in the JSON will be available as ${{ steps.levitate-run.outputs.<field-name> }} # (All fields in the JSON will be available as ${{ steps.levitate-run.outputs.<field-name> }}
- name: Parsing levitate result - name: Parsing levitate result
@ -137,7 +140,7 @@ jobs:
env: env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }} PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
with: with:
github-token: ${{ secrets.GH_BOT_ACCESS_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
await github.rest.issues.addLabels({ await github.rest.issues.addLabels({
issue_number: process.env.PR_NUMBER, issue_number: process.env.PR_NUMBER,
@ -153,7 +156,7 @@ jobs:
env: env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }} PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
with: with:
github-token: ${{ secrets.GH_BOT_ACCESS_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
await github.rest.issues.removeLabel({ await github.rest.issues.removeLabel({
issue_number: process.env.PR_NUMBER, issue_number: process.env.PR_NUMBER,
@ -171,7 +174,7 @@ jobs:
env: env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }} PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
with: with:
github-token: ${{ secrets.GH_BOT_ACCESS_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
await github.rest.pulls.requestReviewers({ await github.rest.pulls.requestReviewers({
pull_number: process.env.PR_NUMBER, pull_number: process.env.PR_NUMBER,
@ -188,7 +191,7 @@ jobs:
env: env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }} PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
with: with:
github-token: ${{ secrets.GH_BOT_ACCESS_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
await github.rest.pulls.removeRequestedReviewers({ await github.rest.pulls.removeRequestedReviewers({
pull_number: process.env.PR_NUMBER, pull_number: process.env.PR_NUMBER,

Loading…
Cancel
Save