-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f53a1e0
commit f024ad6
Showing
2 changed files
with
60 additions
and
15 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 |
---|---|---|
|
@@ -41,8 +41,24 @@ jobs: | |
tmp=$(echo "${{ env.ignore_file_patterns }}" | tr '\n' ' ') | ||
echo "ignore_file_patterns=$tmp" >> $GITHUB_OUTPUT | ||
- name: Checkout Repository | ||
- name: Checkout Repo for PR branch | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout Repo for link check | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'sched-link-checks' | ||
|
||
- name: Sync main to link check branch | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
git config user.name 'github-actions' | ||
git config user.email '[email protected]' | ||
git fetch origin main | ||
git merge origin/main --no-edit -X thiers | ||
git push origin sched-link-checks | ||
- name: Get Changed Files (for PRs) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
@@ -62,7 +78,6 @@ jobs: | |
echo "ignore_file_patterns=${{ steps.setup_vars.outputs.ignore_file_patterns }}" >> $GITHUB_OUTPUT | ||
fi | ||
#exclude_patterns: ${{ steps.setup_vars.outputs.ignore_url_patterns }} | ||
- name: Check URLs in selected files | ||
run: | | ||
for f in ${{ steps.file_list.outputs.files }}; do | ||
|
@@ -78,11 +93,27 @@ jobs: | |
cat linkchecker.out >> linkchecker-all.out | ||
done | ||
- name: Process log | ||
run: | | ||
python utils/LinkChecker/cklcresults.py ${{ github.event_name }} | ||
- name: Finalize Check Status | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
[ $(wc -c utils/LinkChecker/bad_links.txt) -gt 0 ] && exit 1 | ||
- name: Upload artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: my-artifact | ||
path: linkchecker-all.out | ||
name: bad-links | ||
path: utils/LinkChecker/bad_links.txt | ||
|
||
- name: Update link logs | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
git commit -m 'Update link logs' | ||
git push origin sched-link-checks | ||
# | ||
# Keep the recurring failures and definitely bad lists in repo on | ||
|
@@ -102,6 +133,7 @@ jobs: | |
# Report success if definitely bad list is empty, otherwise failure | ||
# generate email with links or actual data | ||
# | ||
# you have to use file:// on command-line to checker | ||
|
||
# bare URLs in markdown are not actually links and will not be checked. Many | ||
# markdown renderers and browsers will recognize these and handle them as links | ||
|
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