diff --git a/CHANGELOG.md b/CHANGELOG.md index f222658..abcc201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - Validate PR - Skip validation for PRs with fewer than 100 lines changed, excluding common lock files (`Cargo.lock`, `yarn.lock`, `package-lock.json`, `Pipfile.lock`, etc.). Tiny PRs no longer go through the issue-discussion loop. - Add validate-pr composite action for validating non-maintainer PRs against contribution guidelines ([#153](https://github.com/getsentry/github-workflows/pull/153)) +### Fixes + +- Updater - Trigger CI for new PRs without changelog updates ([#166](https://github.com/getsentry/github-workflows/pull/166)) + ## 3.3.0 ### Features diff --git a/updater/action.yml b/updater/action.yml index b993ca2..3417729 100644 --- a/updater/action.yml +++ b/updater/action.yml @@ -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: ${{ ( 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"