|
| 1 | +name: check-broken-links |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '8 8 * * 0' |
| 6 | + pull_request: |
| 7 | + types: [opened, synchronize] |
| 8 | + paths: |
| 9 | + - .github/workflows/check-broken-links.yml |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - master |
| 13 | + paths: |
| 14 | + - .github/workflows/check-broken-links.yml |
| 15 | + |
| 16 | +jobs: |
| 17 | + my-broken-link-checker: |
| 18 | + runs-on: ubuntu-18.04 |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Check - container |
| 23 | + uses: ruzickap/action-my-broken-link-checker@v1 |
| 24 | + with: |
| 25 | + url: https://google.com |
| 26 | + cmd_params: --verbose --ignore-fragments --one-page-only |
| 27 | + |
| 28 | + - name: Check - simple |
| 29 | + env: |
| 30 | + INPUT_URL: https://google.com |
| 31 | + INPUT_CMD_PARAMS: --verbose --ignore-fragments --one-page-only |
| 32 | + run: wget -qO- https://raw.githubusercontent.com/ruzickap/action-my-broken-link-checker/v1/entrypoint.sh | bash |
| 33 | + |
| 34 | + - name: Check - simple - local pages |
| 35 | + env: |
| 36 | + INPUT_URL: https://my-testing-domain.com |
| 37 | + INPUT_PAGES_PATH: ./tests/ |
| 38 | + INPUT_CMD_PARAMS: --skip-tls-verification --verbose |
| 39 | + run: |
| 40 | + wget -qO- https://raw.githubusercontent.com/ruzickap/action-my-broken-link-checker/v1/entrypoint.sh | bash |
| 41 | + |
| 42 | + build-check: |
| 43 | + runs-on: ubuntu-18.04 |
| 44 | + steps: |
| 45 | + - name: Create web page |
| 46 | + run: | |
| 47 | + mkdir -v public |
| 48 | + cat > public/index.html << EOF |
| 49 | + <!DOCTYPE html> |
| 50 | + <html> |
| 51 | + <head> |
| 52 | + My page which will be stored on my-testing-domain.com domain |
| 53 | + </head> |
| 54 | + <body> |
| 55 | + Links: |
| 56 | + <ul> |
| 57 | + <li><a href="https://my-testing-domain.com">https://my-testing-domain.com</a></li> |
| 58 | + <li><a href="https://my-testing-domain.com:443">https://my-testing-domain.com:443</a></li> |
| 59 | + </ul> |
| 60 | + </body> |
| 61 | + </html> |
| 62 | + EOF |
| 63 | +
|
| 64 | + - name: Check links using script |
| 65 | + env: |
| 66 | + INPUT_URL: https://my-testing-domain.com |
| 67 | + INPUT_PAGES_PATH: ./public/ |
| 68 | + INPUT_CMD_PARAMS: --skip-tls-verification --verbose |
| 69 | + INPUT_RUN_TIMEOUT: 10 |
| 70 | + INPUT_DEBUG: true |
| 71 | + run: wget -qO- https://raw.githubusercontent.com/ruzickap/action-my-broken-link-checker/v1/entrypoint.sh | bash |
| 72 | + |
| 73 | + - name: Check links using container |
| 74 | + uses: ruzickap/action-my-broken-link-checker@v1 |
| 75 | + with: |
| 76 | + url: https://my-testing-domain.com |
| 77 | + pages_path: ./public/ |
| 78 | + cmd_params: --skip-tls-verification --verbose |
| 79 | + run_timeout: 10 |
| 80 | + debug: true |
0 commit comments