Skip to content

Commit e2e40fa

Browse files
Copilotpelikhan
andauthored
fix(sync-actions): create tag when no changes; tag merge commit when PR merges (#19)
* Initial plan * fix: create tag when no changes and tag merge commit when PR is merged Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * fix: use git checkout -B to robustly reset to origin/main before tagging Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 73dd41c commit e2e40fa

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/sync-actions.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,19 @@ jobs:
329329
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
330330

331331
- name: Create tag
332-
if: steps.resolve-ref.outputs.should_create_tag == 'true' && steps.create-pr.outputs.changed == 'true'
332+
if: steps.resolve-ref.outputs.should_create_tag == 'true'
333333
run: |
334334
echo "::group::Creating Tag"
335335
cd gh-aw-actions
336+
337+
# When a PR was created and merged, we need to pull the merge commit from main
338+
# because the working directory is still on the sync branch.
339+
if [[ "${{ steps.create-pr.outputs.changed }}" == "true" ]]; then
340+
echo "PR was merged — fetching main to tag the merge commit..."
341+
git fetch origin main
342+
git checkout -B main origin/main
343+
fi
344+
336345
TAG="${{ steps.resolve-ref.outputs.raw_ref }}"
337346
echo "Creating tag: $TAG"
338347

0 commit comments

Comments
 (0)