Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/fly-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
jobs:
review_app:
runs-on: ubuntu-latest
# Dependabot PRs run with a separate secrets store and cannot read
# FLY_API_TOKEN, so the review-app deploy fails. Skip them.
if: github.actor != 'dependabot[bot]'
Comment on lines +19 to +21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider hardening the Dependabot detection to cover additional Dependabot identities and trigger types.

github.actor != 'dependabot[bot]' will miss a few cases:

  • Legacy/preview Dependabot uses dependabot-preview[bot].
  • On pull_request events, github.actor may be a human retriggering a Dependabot PR, so checking the actor can be misleading.

For PRs, consider keying off github.event.pull_request.user.login and excluding both dependabot[bot] and dependabot-preview[bot], e.g.:

if: >-
  github.event.pull_request.user.login != 'dependabot[bot]' &&
  github.event.pull_request.user.login != 'dependabot-preview[bot]'

(or equivalent logic for your supported events).

Suggested change
# Dependabot PRs run with a separate secrets store and cannot read
# FLY_API_TOKEN, so the review-app deploy fails. Skip them.
if: github.actor != 'dependabot[bot]'
# Dependabot PRs run with a separate secrets store and cannot read
# FLY_API_TOKEN, so the review-app deploy fails. Skip them.
# For PRs, key off the PR author; for other events, fall back to the actor.
if: >-
(github.event_name == 'pull_request' &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.user.login != 'dependabot-preview[bot]') ||
(github.event_name != 'pull_request' &&
github.actor != 'dependabot[bot]' &&
github.actor != 'dependabot-preview[bot]')

outputs:
url: ${{ steps.deploy.outputs.url }}
# Only run one deployment at a time per PR.
Expand Down
Loading