Skip List screens action check on fork pull requests#302
Open
514sid wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
List screenscheck in .github/workflows/actions.yml fails on every pull request opened from a fork.pull_requestruns 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 runsAPI_TOKEN= screenly screen listunauthenticated, and it exits 1 after a few seconds. The failure is unrelated to any PR's changes, and the job usesscreenly/cli@masterso it never even exercises the PR's own code.Change
Guard the job with an
ifcondition so it only runs for same-repository pull requests, where the secret is available: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.