@@ -12,46 +12,24 @@ jobs:
1212 - name : Checkout repository
1313 uses : actions/checkout@v6
1414 - name : Sync fixtures
15+ id : sync
1516 run : |
1617 TMP_DIR=$(mktemp -d)
1718 curl -fsSL "https://codeload.github.com/dnsimple/dnsimple-developer/tar.gz/refs/heads/main" \
1819 | tar -xz -C "$TMP_DIR"
1920 rsync -a --delete "$TMP_DIR/dnsimple-developer-main/fixtures/v2/" tests/fixtures/v2/
20- - name : Create a PR to sync fixtures if there are changes
21- run : |
22- cat <<'MD' > pr_body.md
23- This PR replaces the fixtures in this repository with those from https://github.com/dnsimple/dnsimple-developer/
24-
25- ## Checklist
26- - [ ] Close and re-open this PR to trigger the CI workflow (it does not run automatically)
27- - [ ] Ensure the CI workflow passes before merging
28- MD
29-
30- # Configure Git identity for the workflow
31- git config --global user.name "github-actions"
32- git config --global user.email "github-actions@github.com"
33-
34- # Create and switch to a new branch
35- BRANCH="chore/sync-fixtures-${GITHUB_RUN_ID}"
36- NOW="$(date +'%Y-%m-%d %H:%M:%S')"
37- git checkout -b "$BRANCH"
38-
39- # Stage changes
40- git add tests/fixtures/v2
41-
42- # Commit if there are staged changes
43- if ! git diff --cached --quiet; then
44- git commit -m "chore: sync test fixtures as of $NOW"
45- git push -u origin "$BRANCH"
46-
47- gh pr create \
48- --title "chore: Sync fixtures as of $NOW" \
49- --body-file pr_body.md \
50- --base main \
51- --head "$BRANCH" \
52- --label "task"
53- else
54- echo "No fixture changes detected; nothing to do"
55- fi
56- env :
57- GITHUB_TOKEN : ${{ github.token }}
21+ echo "now=$(date +'%Y-%m-%d %H:%M:%S')" >> "$GITHUB_OUTPUT"
22+ - name : Create PR with synced fixtures
23+ uses : peter-evans/create-pull-request@v7
24+ with :
25+ sign-commits : true
26+ add-paths : test/fixtures.http
27+ commit-message : " chore: sync test fixtures as of ${{ steps.sync.outputs.now }}"
28+ branch : " chore/sync-fixtures-${{ github.run_id }}"
29+ title : " chore: Sync fixtures as of ${{ steps.sync.outputs.now }}"
30+ body : |
31+ This PR replaces the fixtures in this repository with those from https://github.com/dnsimple/dnsimple-developer/
32+
33+ ## Checklist
34+ - [ ] Close and re-open this PR to trigger the CI workflow (it does not run automatically)
35+ - [ ] Ensure the CI workflow passes before merging
0 commit comments