2020-09-05 16:28:15 +00:00
|
|
|
name: Check URLs from changed files
|
2022-08-31 15:53:22 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
2022-08-29 07:15:25 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2022-08-31 15:53:22 +00:00
|
|
|
|
2022-09-21 13:25:54 +00:00
|
|
|
# This allows a subsequently queued workflow run to interrupt/wait for previous runs
|
2022-08-31 15:53:22 +00:00
|
|
|
concurrency:
|
2022-09-21 13:25:54 +00:00
|
|
|
group: '${{ github.workflow }} @ ${{ github.run_id }}'
|
|
|
|
cancel-in-progress: false # true = interrupt, false = wait
|
2022-08-31 15:53:22 +00:00
|
|
|
|
2020-08-23 17:02:31 +00:00
|
|
|
jobs:
|
2022-08-31 15:53:22 +00:00
|
|
|
check-urls:
|
2020-08-23 17:02:31 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-08-31 15:53:22 +00:00
|
|
|
|
|
|
|
outputs:
|
|
|
|
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
|
|
|
2020-08-23 17:02:31 +00:00
|
|
|
steps:
|
2022-08-31 15:53:22 +00:00
|
|
|
|
|
|
|
# NOTE: tj-actions/changed-files.
|
|
|
|
# For push events you need to include fetch-depth: 0 | 2 depending on your use case.
|
|
|
|
# 0: retrieve all history for all branches and tags
|
2022-09-24 13:03:04 +00:00
|
|
|
# 1: retrieve only current commit (by default)
|
|
|
|
# 2: retrieve until the preceding commit
|
2022-08-31 15:53:22 +00:00
|
|
|
- name: Determine workflow parameters
|
|
|
|
id: init-params
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=fetch_depth::0";
|
|
|
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
2022-09-24 13:03:04 +00:00
|
|
|
echo "::set-output name=fetch_depth::0";
|
2022-08-31 15:53:22 +00:00
|
|
|
fi
|
|
|
|
|
2022-03-07 22:33:24 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-08-23 17:02:31 +00:00
|
|
|
with:
|
2022-08-31 15:53:22 +00:00
|
|
|
fetch-depth: ${{ steps.init-params.outputs.fetch_depth }}
|
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2022-09-24 13:03:04 +00:00
|
|
|
uses: tj-actions/changed-files@v30.0.0
|
2022-08-31 15:53:22 +00:00
|
|
|
with:
|
|
|
|
separator: " "
|
|
|
|
|
2020-08-23 17:02:31 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
2022-02-15 15:38:57 +00:00
|
|
|
ruby-version: 2.6
|
2022-08-31 15:53:22 +00:00
|
|
|
|
|
|
|
- run: |
|
|
|
|
gem install awesome_bot
|
|
|
|
|
|
|
|
- name: Check each changed file
|
|
|
|
run: |
|
|
|
|
# Set field separator
|
|
|
|
IFS=$' ';
|
|
|
|
|
|
|
|
# Processing loop
|
|
|
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
|
|
|
echo;
|
|
|
|
echo "::group::Processing file... $file";
|
|
|
|
awesome_bot "$file" --allow-redirect --allow-dupe --allow-ssl || true;
|
|
|
|
echo "::endgroup::";
|
|
|
|
done
|
|
|
|
|
|
|
|
# Unset field separator
|
|
|
|
unset IFS;
|
|
|
|
|
2022-04-11 13:32:25 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-09-05 16:28:15 +00:00
|
|
|
with:
|
2022-08-31 15:53:22 +00:00
|
|
|
name: awesomebot-results
|
|
|
|
path: ${{ github.workspace }}/ab-results-*.json
|
|
|
|
|
|
|
|
- name: Generate Summary Report using AwesomeBot results
|
|
|
|
uses: ./.github/actions/awesomebot-gh-summary-action
|
|
|
|
with:
|
|
|
|
ab-root: ${{ github.workspace }}
|
|
|
|
files: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
|
|
separator: " "
|
|
|
|
append-heading: ${{ true }}
|