Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Push changes on link-check refcache diff #6140

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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