Update url-check.yml #6
Workflow file for this run
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
on: | |
push: | |
branches: [hrm_test] | |
pull_request: | |
branches: [hrm_test] | |
name: url-check | |
jobs: | |
url-check: | |
runs-on: ubuntu-latest | |
# env: | |
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::urlchecker | |
- name: Run URL Check | |
run: | | |
R -e " | |
library(urlchecker) | |
check <- urlchecker::url_check() | |
if(nrow(check) > 0) { | |
print('The following URLs are broken:\n') | |
print(paste(check$URL, sep = '\n')) | |
quit(status = 1) | |
} else { | |
print('All URLs are valid.\n') | |
} | |
" |