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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Fixes

- Updater - Trigger CI for new PRs without changelog updates ([#166](https://github.com/getsentry/github-workflows/pull/166))
- Updater - Select the first branch when multiple branches point at `HEAD` ([#165](https://github.com/getsentry/github-workflows/pull/165))

### Dependencies
Expand Down
29 changes: 29 additions & 0 deletions updater/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,32 @@ runs:
Auto-generated by a [dependency updater](https://github.com/getsentry/github-workflows/blob/main/updater/action.yml).
${{ env.TARGET_CHANGELOG }}
labels: dependencies

- name: Trigger PR workflows
if: ${{ (inputs.changelog-entry != 'true') && ( steps.create-pr.outputs.pull-request-operation == 'created' ) && ( steps.update.outputs.pull-request-head-sha == '' || steps.update.outputs.pull-request-head-sha == steps.create-pr.outputs.pull-request-head-sha ) }}
shell: bash
working-directory: caller-repo
env:
PR_BRANCH: ${{ steps.root.outputs.prBranch }}
PR_HEAD_SHA: ${{ steps.create-pr.outputs.pull-request-head-sha }}
API_TOKEN: ${{ inputs.api-token }}
SSH_KEY: ${{ inputs.ssh-key }}
run: |
git fetch origin "$PR_BRANCH"
git checkout --force -B "$PR_BRANCH" "origin/$PR_BRANCH"

current_head=$(git rev-parse HEAD)
if [ "$current_head" != "$PR_HEAD_SHA" ]; then
echo "::notice::PR branch changed from $PR_HEAD_SHA to $current_head; skipping synthetic CI trigger."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit --amend --no-edit

if [ -n "$API_TOKEN" ] && [ -z "$SSH_KEY" ]; then
git remote set-url origin "https://x-access-token:${API_TOKEN}@github.com/${{ github.repository }}.git"
fi

git push --force-with-lease="refs/heads/$PR_BRANCH:$PR_HEAD_SHA" origin "HEAD:refs/heads/$PR_BRANCH"
Loading