Skip to content

Skip List screens action check on fork pull requests#302

Open
514sid wants to merge 1 commit into
Screenly:masterfrom
514sid:ci/skip-list-screens-on-fork-prs
Open

Skip List screens action check on fork pull requests#302
514sid wants to merge 1 commit into
Screenly:masterfrom
514sid:ci/skip-list-screens-on-fork-prs

Conversation

@514sid

@514sid 514sid commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

The List screens check in .github/workflows/actions.yml fails on every pull request opened from a fork.

pull_request runs triggered from a forked repository do not receive repository secrets (a GitHub security measure to keep untrusted PR code from exfiltrating them). As a result ${{ secrets.SCREENLY_API_TOKEN }} expands to empty, the action runs API_TOKEN= screenly screen list unauthenticated, and it exits 1 after a few seconds. The failure is unrelated to any PR's changes, and the job uses screenly/cli@master so it never even exercises the PR's own code.

Change

Guard the job with an if condition so it only runs for same-repository pull requests, where the secret is available:

if: github.event.pull_request.head.repo.full_name == github.repository

Fork PRs will simply skip the job instead of showing a red failure. Same-repo PRs (including maintainer branches) run it exactly as before.

I avoided pull_request_target, which would expose the secret to fork PR code and is a known security risk.

pull_request runs triggered from forks don't receive repository secrets,
so SCREENLY_API_TOKEN is empty and the 'screen list' integration check
fails auth and exits 1 (unrelated to the PR's changes). Guard the job
with an if condition so it only runs for same-repository pull requests,
where the token is available.
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.

1 participant