From 7f72aa5bba1e30c7a37b7b0999f6815748149526 Mon Sep 17 00:00:00 2001 From: Juan Ku Quintana Date: Fri, 20 Mar 2026 08:12:02 -0600 Subject: [PATCH 1/2] Sign fixture sync commits via GitHub API --- .github/workflows/sync-test-fixtures.yml | 54 +++++++----------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/.github/workflows/sync-test-fixtures.yml b/.github/workflows/sync-test-fixtures.yml index b04fa76..8e79619 100644 --- a/.github/workflows/sync-test-fixtures.yml +++ b/.github/workflows/sync-test-fixtures.yml @@ -12,46 +12,24 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - name: Sync fixtures + id: sync run: | TMP_DIR=$(mktemp -d) curl -fsSL "https://codeload.github.com/dnsimple/dnsimple-developer/tar.gz/refs/heads/main" \ | tar -xz -C "$TMP_DIR" rsync -a --delete "$TMP_DIR/dnsimple-developer-main/fixtures/v2/api/" src/test/resources/com/dnsimple/ - - name: Create a PR to sync fixtures if there are changes - run: | - cat <<'MD' > pr_body.md - This PR replaces the fixtures in this repository with those from https://github.com/dnsimple/dnsimple-developer/ - - ## Checklist - - [ ] Close and re-open this PR to trigger the CI workflow (it does not run automatically) - - [ ] Ensure the CI workflow passes before merging - MD - - # Configure Git identity for the workflow - git config --global user.name "github-actions" - git config --global user.email "github-actions@github.com" - - # Create and switch to a new branch - BRANCH="chore/sync-fixtures-${GITHUB_RUN_ID}" - NOW="$(date +'%Y-%m-%d %H:%M:%S')" - git checkout -b "$BRANCH" - - # Stage changes - git add src/test/resources/com/dnsimple - - # Commit if there are staged changes - if ! git diff --cached --quiet; then - git commit -m "chore: sync test fixtures as of $NOW" - git push -u origin "$BRANCH" - - gh pr create \ - --title "chore: Sync fixtures as of $NOW" \ - --body-file pr_body.md \ - --base main \ - --head "$BRANCH" \ - --label "task" - else - echo "No fixture changes detected; nothing to do" - fi - env: - GITHUB_TOKEN: ${{ github.token }} + echo "now=$(date +'%Y-%m-%d %H:%M:%S')" >> "$GITHUB_OUTPUT" + - name: Create PR with synced fixtures + uses: peter-evans/create-pull-request@v7 + with: + sign-commits: true + add-paths: test/fixtures.http + commit-message: "chore: sync test fixtures as of ${{ steps.sync.outputs.now }}" + branch: "chore/sync-fixtures-${{ github.run_id }}" + title: "chore: Sync fixtures as of ${{ steps.sync.outputs.now }}" + body: | + This PR replaces the fixtures in this repository with those from https://github.com/dnsimple/dnsimple-developer/ + + ## Checklist + - [ ] Close and re-open this PR to trigger the CI workflow (it does not run automatically) + - [ ] Ensure the CI workflow passes before merging From 3ddac8b41baf2386b65a155f843791b36676193d Mon Sep 17 00:00:00 2001 From: Juan Ku Quintana Date: Fri, 20 Mar 2026 09:17:12 -0600 Subject: [PATCH 2/2] Fix fixture sync path --- .github/workflows/sync-test-fixtures.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-test-fixtures.yml b/.github/workflows/sync-test-fixtures.yml index 8e79619..931e583 100644 --- a/.github/workflows/sync-test-fixtures.yml +++ b/.github/workflows/sync-test-fixtures.yml @@ -23,7 +23,7 @@ jobs: uses: peter-evans/create-pull-request@v7 with: sign-commits: true - add-paths: test/fixtures.http + add-paths: src/test/resources/com/dnsimple commit-message: "chore: sync test fixtures as of ${{ steps.sync.outputs.now }}" branch: "chore/sync-fixtures-${{ github.run_id }}" title: "chore: Sync fixtures as of ${{ steps.sync.outputs.now }}"