Skip to content

Commit 75d3459

Browse files
committed
fix: only commit tracked authors.yml; robust change detection
1 parent e8d61ed commit 75d3459

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/sync-authors-on-pr.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@ jobs:
4343
USE_RAW_PFP_URLS: 'true'
4444
run: pnpm --filter @handbook/scripts run script:infra:sync-authors
4545

46-
- name: Detect changes
46+
- name: Detect changes (tracked authors.yml only)
4747
id: git_status
4848
run: |
49-
echo "changed=$(git status --porcelain | wc -l | tr -d ' ')" >> $GITHUB_OUTPUT
49+
if git diff --quiet -- sites/wonderland/blog/authors.yml; then
50+
echo "changed=0" >> $GITHUB_OUTPUT
51+
else
52+
echo "changed=1" >> $GITHUB_OUTPUT
53+
fi
5054
5155
- name: Commit changes
5256
if: steps.git_status.outputs.changed != '0'
5357
run: |
5458
git config user.name "github-actions[bot]"
5559
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
56-
git add sites/wonderland/blog/authors.yml sites/wonderland/static/img/pfp || true
57-
git commit -m "chore(ci): sync authors from squad.json"
60+
git add sites/wonderland/blog/authors.yml || true
61+
git commit -m "chore(ci): sync authors from squad.json" || true
5862
5963
- name: Push changes to PR branch
6064
if: steps.git_status.outputs.changed != '0' && github.event_name == 'pull_request'

0 commit comments

Comments
 (0)