newrelic-quickstarts
newrelic-quickstarts copied to clipboard
[Sustaining] Update github-script
Description
The Github action we use to enable/disable branch protection, github-script, is currently on version 5 and we're running version 1. We have also observed 404 errors coming from v1 in the instant-observability-website.
To avoid running into errors let's upgrade our version of github-script.
helpful links
Example changes
before
- name: Temporarily disable branch protection
id: disable-branch-protection
uses: actions/github-script@v1
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)
after
- name: Temporarily disable branch protection
id: disable-branch-protection
uses: actions/github-script@v5
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)
Notice that the changes are just updating the version and add .rest
to the call path.
AC
- [ ] All instances of github-script have been updated to v5
The 404 error does not appear to be exclusive to v1
, however these updates should still be made.
Old issues will be closed after 105 days of inactivity. This issue has been quiet for 90 days and is being marked as stale. Reply here to keep this issue open.
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new one.