Skip to content

🏥 CI FailureTest Setup Action: "latest" version lookup fails with 403 on private repo #1155

@github-actions

Description

@github-actions

Summary

The Test Setup Action workflow (run #22732917329) failed on commit 8c6047f. Only the Test Action (Latest Version) job failed; the three other jobs (Specific Version, With Image Pull, Invalid Version) all passed.

Root Cause

action.yml fetches the latest release tag using an unauthenticated curl request:

VERSION=$(curl -fsSL "https://api.github.com/repos/github/gh-aw-firewall/releases/latest" | jq -r '.tag_name')
```

Since `github/gh-aw-firewall` is a **private repository**, unauthenticated GitHub API calls return **HTTP 403 Forbidden**:

```
Fetching latest release version...
curl: (22) The requested URL returned error: 403
##[error]Process completed with exit code 22.

Jobs that specify a concrete version (e.g., v0.7.0) skip this API call entirely and succeed. Only the latest path is broken.

Affected File

  • action.yml lines 63–64 (and the fallback at line 66) — both curl calls lack an Authorization header

Recommended Fix

Add a token input to action.yml and pass it to the curl call:

# action.yml inputs
inputs:
  token:
    description: 'GitHub token for API access (required to resolve latest version on private repos)'
    required: false
    default: $\{\{ github.token }}

Then in the install step:

VERSION=$(curl -fsSL -H "Authorization: Bearer $INPUT_TOKEN" \
  "https://api.github.com/repos/\$\{REPO}/releases/latest" | jq -r '.tag_name')

And in test-action.yml test-action-latest job, pass the token explicitly (or rely on the default):

- name: Setup awf using action
  uses: ./
  with:
    token: $\{\{ github.token }}

References

Generated by CI Doctor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingci

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions