chore(ci): update GitHub Actions to latest major versions (#5462)

* chore(ci): update GitHub Actions to latest major versions

Update actions/cache v4→v5, actions/github-script v3→v7,
actions/stale v9→v10, docker/login-action v3→v4,
docker/setup-buildx-action v3→v4, and docker/metadata-action v5→v6.
The github-script upgrade also migrates Octokit API calls from
github.* to github.rest.* namespace (required since v5).

* fix(ci): address review feedback on GitHub Actions update

Pass github_token to docker/metadata-action@v6 to avoid API rate
limiting. Fix github-script pagination to use the correct Octokit
paginate.iterator pattern (pass endpoint method, not awaited response).
This commit is contained in:
Deluan Quintão 2026-05-04 13:59:05 -04:00 committed by GitHub
parent dd2b6865b0
commit a34a4abbc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

View file

@ -53,13 +53,13 @@ runs:
- name: Login to Docker Hub - name: Login to Docker Hub
if: inputs.hub_username != '' && inputs.hub_password != '' if: inputs.hub_username != '' && inputs.hub_password != ''
uses: docker/login-action@v3 uses: docker/login-action@v4
with: with:
username: ${{ inputs.hub_username }} username: ${{ inputs.hub_username }}
password: ${{ inputs.hub_password }} password: ${{ inputs.hub_password }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v4
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -67,12 +67,13 @@ runs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v4
- name: Extract metadata for Docker image - name: Extract metadata for Docker image
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v6
with: with:
token: ${{ inputs.github_token }}
labels: | labels: |
maintainer=deluan@navidrome.org maintainer=deluan@navidrome.org
images: | images: |

View file

@ -8,7 +8,7 @@ jobs:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v3 - uses: actions/github-script@v7
with: with:
# This snippet is public-domain, taken from # This snippet is public-domain, taken from
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml # https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
@ -19,8 +19,7 @@ jobs:
const pull_user_id = ${{github.event.sender.id}}; const pull_user_id = ${{github.event.sender.id}};
const issue_number = await (async () => { const issue_number = await (async () => {
const pulls = await github.pulls.list({owner, repo}); for await (const {data} of github.paginate.iterator(github.rest.pulls.list, {owner, repo})) {
for await (const {data} of github.paginate.iterator(pulls)) {
for (const pull of data) { for (const pull of data) {
if (pull.head.sha === pull_head_sha && pull.user.id === pull_user_id) { if (pull.head.sha === pull_head_sha && pull.user.id === pull_user_id) {
return pull.number; return pull.number;
@ -34,7 +33,7 @@ jobs:
return core.error(`No matching pull request found`); return core.error(`No matching pull request found`);
} }
const {data: {artifacts}} = await github.actions.listWorkflowRunArtifacts({owner, repo, run_id}); const {data: {artifacts}} = await github.rest.actions.listWorkflowRunArtifacts({owner, repo, run_id});
if (!artifacts.length) { if (!artifacts.length) {
return core.error(`No artifacts found`); return core.error(`No artifacts found`);
} }
@ -43,12 +42,12 @@ jobs:
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
} }
const {data: comments} = await github.issues.listComments({repo, owner, issue_number}); const {data: comments} = await github.rest.issues.listComments({repo, owner, issue_number});
const existing_comment = comments.find((c) => c.user.login === 'github-actions[bot]'); const existing_comment = comments.find((c) => c.user.login === 'github-actions[bot]');
if (existing_comment) { if (existing_comment) {
core.info(`Updating comment ${existing_comment.id}`); core.info(`Updating comment ${existing_comment.id}`);
await github.issues.updateComment({repo, owner, comment_id: existing_comment.id, body}); await github.rest.issues.updateComment({repo, owner, comment_id: existing_comment.id, body});
} else { } else {
core.info(`Creating a comment`); core.info(`Creating a comment`);
await github.issues.createComment({repo, owner, issue_number, body}); await github.rest.issues.createComment({repo, owner, issue_number, body});
} }

View file

@ -145,7 +145,7 @@ jobs:
- name: Cache ffmpeg - name: Cache ffmpeg
id: ffmpeg-cache id: ffmpeg-cache
uses: actions/cache@v4 uses: actions/cache@v5
with: with:
path: C:\ffmpeg path: C:\ffmpeg
key: ffmpeg-${{ env.FFMPEG_VERSION }}-win64 key: ffmpeg-${{ env.FFMPEG_VERSION }}-win64

View file

@ -28,7 +28,7 @@ jobs:
This pull request has been automatically locked since there This pull request has been automatically locked since there
has not been any recent activity after it was closed. has not been any recent activity after it was closed.
Please open a new issue for related bugs. Please open a new issue for related bugs.
- uses: actions/stale@v9 - uses: actions/stale@v10
with: with:
operations-per-run: 999 operations-per-run: 999
days-before-issue-stale: 180 days-before-issue-stale: 180