Skip to content

Commit

Permalink
Small updates to the link verifier action
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak committed Sep 5, 2023
1 parent 6b3a6be commit 336cbfe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions link-verifier/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,31 @@ runs:
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m
stepName: Run link verifier script
stepName: Check Links in Files
name: ${{ env.stepName }}
working-directory: ${{ inputs.path }}
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
args="--test-markdown"
if [ -n "${{ inputs.exclude-dirs }}" ]; then
dirs="${{ inputs.exclude-dirs }}"
dirs="${dirs//,/ }"
args+=" --exclude-dirs ${dirs}"
fi
if [ -n "${{ inputs.include-file-types }}" ]; then
file_types="${{ inputs.include-file-types }}"
file_types="${file_types//,/ }"
args+=" --include-file-types ${file_types}"
fi
if [ -n "${{ inputs.allowlist-file }}" ]; then
touch allowList.txt
cat ${{ inputs.allowlist-file }} >> allowList.txt
fi
if [[ "${{ inputs.exclude-urls }}" != "" ]]; then
touch allowList.txt
exclude_urls="${{ inputs.exclude-urls }}"
Expand All @@ -105,11 +108,12 @@ runs:
args+=" --allowlist-file allowList.txt"
fi
echo -e "${{ env.bashInfo }} Running verify-links.py ${args} --user-agent \"${{ inputs.user-agent }}\" ${{ env.bashEnd }}"
echo -e "${{ env.bashInfo }} Running: verify-links.py ${args} --user-agent \"${{ inputs.user-agent }}\" ${{ env.bashEnd }}"
set +e
python3 ${GITHUB_ACTION_PATH}/verify-links.py ${args} --user-agent "${{ inputs.user-agent }}";
exitStatus=$?
set -e
echo -e "::endgroup::"
# We check the backwards condition for this one
if [ $exitStatus -eq 1 ]; then
Expand Down

0 comments on commit 336cbfe

Please sign in to comment.