Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a027937
workflow run testing
symbiontik Apr 21, 2023
35b8165
default branch only workaround test
symbiontik Apr 21, 2023
646d974
where theres a will, theres a way
symbiontik Apr 21, 2023
a0157f2
order steps
symbiontik Apr 21, 2023
de4381b
testing
symbiontik Apr 21, 2023
b54d9db
testing again
symbiontik Apr 21, 2023
992abd6
test with doc changes
symbiontik Apr 21, 2023
3f9e5ae
exit code tester
symbiontik Apr 21, 2023
776b9dd
test
symbiontik Apr 21, 2023
9761c5a
testeroni
symbiontik Apr 21, 2023
4e7810c
u test me
symbiontik Apr 21, 2023
684ebc7
PR comment testing
symbiontik Apr 21, 2023
56109e4
testing
symbiontik Apr 26, 2023
4158e99
test again
symbiontik Apr 26, 2023
ff34e2b
testing
symbiontik Apr 26, 2023
ed824f6
testing again
symbiontik Apr 26, 2023
c000bd2
incremental testing
symbiontik Apr 26, 2023
131971a
more incremental testing
symbiontik Apr 26, 2023
d977ada
ink ra men tal
symbiontik Apr 26, 2023
a8ee86f
either recreate or exit code
symbiontik Apr 26, 2023
e772595
problems with recreate
symbiontik Apr 26, 2023
fc682ef
if clauses
symbiontik Apr 26, 2023
a5e75b2
tshoot
symbiontik Apr 26, 2023
0f52b3b
these machines man
symbiontik Apr 26, 2023
5302648
test
symbiontik Apr 26, 2023
00c1f64
testt
symbiontik Apr 26, 2023
d45e8c4
exit code testing
symbiontik Apr 26, 2023
866b700
double test
symbiontik Apr 26, 2023
8a88907
testing
symbiontik Apr 26, 2023
a6231e9
do you need if statements for failure code
symbiontik Apr 26, 2023
7971584
test working scenario
symbiontik Apr 26, 2023
8acbdbc
test big test
symbiontik Apr 26, 2023
180dca9
what happens to the pr comment when all links work
symbiontik Apr 26, 2023
c5c5da5
big testing
symbiontik Apr 26, 2023
a784c32
test failure scenario
symbiontik Apr 26, 2023
f99bbcb
success scenario test
symbiontik Apr 26, 2023
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
64 changes: 55 additions & 9 deletions .github/workflows/broken-link-checker-inline.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
name: Broken Link Check

on:
workflow_run:
workflows: ["Helm Linter"]
types:
- completed
workflow_dispatch:
push:

permissions:
pull-requests: write
checks: read
contents: read

jobs:
linkChecker:
name: Link Checker
runs-on: ubuntu-latest
steps:

- name: Wait for Helm Linter workflow to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
#ref: ${{ github.event.pull_request.head.sha }}
check-name: helmLinter
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down Expand Up @@ -45,15 +59,47 @@ jobs:
id: lychee
uses: lycheeverse/[email protected]
with:
args: ${{ steps.changed-files.outputs.all_changed_files }} --base https://tutorials-git-${{ steps.findPr.outputs.pr }}-hashicorp.vercel.app/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --max-concurrency=24 --no-progress --verbose
# Fail GitHub action when broken links are found?
fail: true
args: ${{ steps.changed-files.outputs.all_changed_files }} --base https://developer.hashicorp.com/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --max-concurrency=24 --no-progress --verbose
jobSummary: true
# Fail GitHub action at this step when broken links are found?
fail: false
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Comment on PR with lychee output
# - name: Troubleshoot Append text to beginning of Lychee output file
# if: env.lychee_exit_code != 0
# run: |
# ls
# cat lychee/out.md

- name: Append text to beginning of Lychee output file if broken links found
# Append lychee output file under any lychee condition
if: env.lychee_exit_code != 0
run: |
sed -i '1s/^/The GitHub action "Broken Link Check" has completed running on all content within the scope of this PR.\n/' ./lychee/out.md

# Comment on PR with lychee output; subsequent runs will modify existing content with latest results
- name: Comment on PR with lychee output if broken links found
if: env.lychee_exit_code != 0
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Link Checker Report
content-filepath: ./lychee/out.md
number: ${{ steps.findPr.outputs.pr }}
path: ./lychee/out.md
recreate: true

# Fail github action if lychee exit code is anything other than the success code (0)
- name: lychee exit code check
if: env.lychee_exit_code != 0
uses: actions/github-script@v3
with:
script: |
core.setFailed('lychee failed with exit code ${{env.lychee_exit_code}}')

# If all previous Github actions run (indicating success), this one will run and clean up PR comments
- name: Clean up PR comments if all previous steps succeed
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Link Checker Report
number: ${{ steps.findPr.outputs.pr }}
delete: true
2 changes: 1 addition & 1 deletion .github/workflows/helm-linter-inline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:

jobs:
linkChecker:
helmLinter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down