Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ Cherry-picks a specific commit into a target branch.

**File:** `dependabot-azp-trigger.yml`

Automatically comments `/azp run PR` on pull requests opened or updated by Dependabot, triggering Azure Pipelines CI without manual intervention.
Automatically comments `/azp run PR` on pull requests opened or updated by Dependabot, triggering Azure Pipelines CI without manual intervention. The comment is posted using rnbot's PAT (`RNBOT_GITHUB_PAT`) so AZP recognizes the trigger.

**Trigger:** Runs on `pull_request_target` events (`opened`, `synchronize`, `reopened`) when the PR author is `dependabot[bot]`.

**Setup:** Requires a `RNBOT_GITHUB_PAT` GitHub Actions secret containing rnbot's personal access token with `repo` scope.

**Notes:**

- Uses `pull_request_target` so the workflow has write permissions to comment on Dependabot PRs
- Checks `github.event.pull_request.user.login` (not `github.actor`) so it still triggers when a maintainer clicks "Update branch"
- Fires on `opened`, `synchronize` (new pushes/rebases), and `reopened` events
5 changes: 1 addition & 4 deletions .github/workflows/dependabot-azp-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write

jobs:
trigger-azp:
if: github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Comment /azp run PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.RNBOT_GITHUB_PAT }}
run: |
gh pr comment "${{ github.event.pull_request.number }}" \
--repo "${{ github.repository }}" \
Expand Down
Loading