Skip to content

chore: bump actions in ci#2665

Open
bitsandfoxes wants to merge 8 commits into
mainfrom
chore/ci-bump-deps
Open

chore: bump actions in ci#2665
bitsandfoxes wants to merge 8 commits into
mainfrom
chore/ci-bump-deps

Conversation

@bitsandfoxes
Copy link
Copy Markdown
Contributor

@bitsandfoxes bitsandfoxes commented May 6, 2026

This addresses the 79 warnings that

Node.js 20 actions are deprecated.

which will hit us in June.

#skip-changelog

Copy link
Copy Markdown
Contributor Author

@bitsandfoxes bitsandfoxes May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We previously relied on this fork https://github.com/vaind/download-artifact (that is in dire need of getting synced), or, like here, we wrap action/download-artifact in 10 lines of bash and call it a day.

@bitsandfoxes bitsandfoxes requested a review from a team May 8, 2026 08:56
@bitsandfoxes bitsandfoxes marked this pull request as ready for review May 8, 2026 08:56
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 977760a. Configure here.

Comment thread .github/workflows/build.yml
Comment on lines +18 to +28
shell: pwsh
run: |
for ($i = 0; $i -lt 120; $i++) {
$count = gh api "/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts?name=$env:NAME" --jq .total_count
if ([int]$count -gt 0) {
exit 0
}
Start-Sleep -Seconds 30
}
Write-Error "Timed out after 60 minutes waiting for artifact: $env:NAME"
exit 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Several jobs and reusable workflows using the wait-for-artifact action are missing the required actions: read permission, which will cause API calls to fail.
Severity: HIGH

Suggested Fix

Add the actions: read permission to the permissions block for all jobs that call the wait-for-artifact action. This includes the test-build-webgl and package-validation jobs in ci.yml, and the jobs in ci.yml that call the reusable test/build workflows.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/actions/wait-for-artifact/action.yml#L14-L28

Potential issue: The custom `wait-for-artifact` action calls a GitHub API endpoint that
requires `actions: read` permission. While this permission was added to the `build.yml`
file and the `build-unity-sdk` job in `ci.yml`, it was not added to other jobs and
reusable workflows that also use this new action. Specifically, the `test-build-webgl`
and `package-validation` jobs in `ci.yml`, as well as the `test-build-android.yml`,
`test-build-linux.yml`, `test-build-windows.yml`, and `test-build-ios.yml` reusable
workflows, are all missing this permission. When these workflows run, the `gh api` call
will fail with a permission denied error, causing the step to fail.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment on lines +22 to +23
if ([int]$count -gt 0) {
exit 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The PowerShell script in wait-for-artifact will crash if the gh api call fails, as it tries to cast an empty string to an integer without error handling.
Severity: HIGH

Suggested Fix

Wrap the gh api call and subsequent type cast in a try/catch block. In the catch block, handle the error gracefully, for instance by logging a warning and allowing the loop to continue to the next iteration. This will ensure that transient API failures do not crash the entire action and that the polling mechanism can retry as intended.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/actions/wait-for-artifact/action.yml#L22-L23

Potential issue: In the `wait-for-artifact` action, the PowerShell script polls for an
artifact's existence. It executes a `gh api` command and attempts to cast the result to
an integer using `[int]$count`. If the `gh api` command fails for any reason (e.g., a
permission error, a transient network issue, or rate limiting), the output variable
`$count` will be an empty string. The cast `[int]""` then throws a terminating
`InvalidCastException`, which is unhandled and immediately crashes the entire step. This
bypasses the intended 60-minute retry loop, making the action fail instantly on any API
error rather than retrying.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants