-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Push changes on link-check refcache diff (#6140)
- Loading branch information
Showing
1 changed file
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|