Skip to content

Commit

Permalink
[CI] Push changes on link-check refcache diff (#6140)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Jan 31, 2025
1 parent ba06db3 commit 7ca4cb7
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Links

# cSpell:ignore nvmrc opentelemetrybot
on:
merge_group:
pull_request:
Expand Down Expand Up @@ -44,10 +45,28 @@ jobs:
- run: npm run log:check:links
continue-on-error: true
- name: Any files need updating?

- name: Push changes if any, and fail check
run: |
echo "If the diff fails due to .htmltest, then either run 'npm run fix:htmltest-config' locally or '/fix:htmltest-config' in GitHub"
npm run _diff:fail
if [[ $(git status --porcelain) ]]; then
echo "Changes detected in the refcache etc:"
git status --short
echo "\nPushing changes to PR."
git config --local user.email "$USER_EMAIL"
git config --local user.name "$USER_NAME"
git add -A
git commit -m "Updates from build-and-check-links workflow"
git push
echo "Failing workflow so that changes can be reviewed, and checks rerun."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
USER_EMAIL: [email protected]
USER_NAME: opentelemetrybot

- uses: actions/upload-artifact@v4
with:
name: build-log-etc
Expand Down

0 comments on commit 7ca4cb7

Please sign in to comment.