-
Notifications
You must be signed in to change notification settings - Fork 3
Update actions/github-script action to v8 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This change updates the GitHub workflow for cleaning up build references by upgrading the Walkthrough
Model: o4-mini | Prompt Tokens: 314 | Completion Tokens: 356 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is supportive feedback on your code, powered by AI insights. Some suggestions may not suit every situation, so pick what works best for you. You guide the process while AI lends a helpful hand.
Model: o4-mini | Prompt Tokens: 724 | Completion Tokens: 2160
| contents: write | ||
| steps: | ||
| - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
| - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re pinning the action by its full commit SHA, which reduces readability and makes upgrades harder. It’s usually better to target the major version tag (e.g. @v8) or a full semver range to get non-breaking updates automatically. For example:
steps:
- uses: actions/github-script@v8 # pulls latest v8.x.x
with:
script: |
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/heads/old-branch'
})| contents: write | ||
| steps: | ||
| - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
| - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline comment for the version (# v8.0.0) is now out of sync with your SHA pin. Either update or remove it entirely to avoid confusion. If you switch to @v8 you can drop the comment, since it’s implied by the tag’s semantics.
| script: | | ||
| github.rest.git.deleteRef({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s safer to wrap the delete in a try/catch so that a missing ref (404) won’t fail the entire workflow. Here’s an example:
with:
script: |
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/heads/old-branch'
})
console.log('Ref deleted successfully')
} catch (error) {
if (error.status === 404) {
console.log('Branch not found, skipping deletion')
} else {
throw error
}
}
This PR contains the following updates:
v7.0.1->v8.0.0Release Notes
actions/github-script (actions/github-script)
v8.0.0Compare Source
v7.1.0Compare Source
Configuration
📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.