Skip to content

Commit 7ca4cb7

Browse files
authored
[CI] Push changes on link-check refcache diff (open-telemetry#6140)
1 parent ba06db3 commit 7ca4cb7

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/check-links.yml

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Links
22

3+
# cSpell:ignore nvmrc opentelemetrybot
34
on:
45
merge_group:
56
pull_request:
@@ -44,10 +45,28 @@ jobs:
4445
4546
- run: npm run log:check:links
4647
continue-on-error: true
47-
- name: Any files need updating?
48+
49+
- name: Push changes if any, and fail check
4850
run: |
49-
echo "If the diff fails due to .htmltest, then either run 'npm run fix:htmltest-config' locally or '/fix:htmltest-config' in GitHub"
50-
npm run _diff:fail
51+
if [[ $(git status --porcelain) ]]; then
52+
echo "Changes detected in the refcache etc:"
53+
git status --short
54+
55+
echo "\nPushing changes to PR."
56+
git config --local user.email "$USER_EMAIL"
57+
git config --local user.name "$USER_NAME"
58+
git add -A
59+
git commit -m "Updates from build-and-check-links workflow"
60+
git push
61+
62+
echo "Failing workflow so that changes can be reviewed, and checks rerun."
63+
exit 1
64+
fi
65+
env:
66+
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
67+
USER_EMAIL: [email protected]
68+
USER_NAME: opentelemetrybot
69+
5170
- uses: actions/upload-artifact@v4
5271
with:
5372
name: build-log-etc

0 commit comments

Comments
 (0)