Skip to content

Commit 31f340f

Browse files
sentry-junior[bot]juniordcramer
authored
fix(warden): Skip reviews for fork pull requests (#204)
* fix(warden): Skip reviews for fork pull requests Co-Authored-By: junior <junior@sentry.io> Co-Authored-By: David Cramer <david@sentry.io> * refactor(warden): Remove Dependabot credential branch Dependabot now has access to the required secrets, so retain one actionable failure path for any non-fork pull request with a missing Actions secret. Co-Authored-By: junior <junior@sentry.io> Co-Authored-By: David Cramer <david@sentry.io> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: junior <junior@sentry.io> Co-authored-by: David Cramer <david@sentry.io>
1 parent e188f3f commit 31f340f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

.github/workflows/warden.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
warden:
9+
if: github.event.pull_request.head.repo.full_name == github.repository
910
runs-on: ubuntu-latest
1011
permissions:
1112
contents: read
@@ -19,20 +20,12 @@ jobs:
1920
- name: Check Warden credentials
2021
env:
2122
HAS_OPENROUTER_API_KEY: ${{ secrets.WARDEN_OPENROUTER_API_KEY != '' }}
22-
IS_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
23-
IS_DEPENDABOT: ${{ github.actor == 'dependabot[bot]' }}
2423
run: |
2524
if [[ "$HAS_OPENROUTER_API_KEY" == "true" ]]; then
2625
exit 0
2726
fi
2827
29-
if [[ "$IS_FORK" == "true" ]]; then
30-
MESSAGE="Warden cannot review this fork pull request because GitHub withholds repository secrets from fork workflows."
31-
elif [[ "$IS_DEPENDABOT" == "true" ]]; then
32-
MESSAGE="Warden cannot review this Dependabot pull request because WARDEN_OPENROUTER_API_KEY is unavailable. Add it to the organization Dependabot secrets."
33-
else
34-
MESSAGE="Warden cannot review this pull request because WARDEN_OPENROUTER_API_KEY is unavailable. Add it to the organization Actions secrets."
35-
fi
28+
MESSAGE="Warden cannot review this pull request because WARDEN_OPENROUTER_API_KEY is unavailable. Add it to the organization Actions secrets."
3629
3730
echo "::error::$MESSAGE"
3831
printf '## Warden unavailable\n\n%s\n' "$MESSAGE" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)