-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afb257c
commit df91e59
Showing
1 changed file
with
35 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,45 @@ | ||
name: Check URL Status | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 0 * * 0 | ||
env: | ||
LINK_TRACKING_ISSUE_NUMBER: 322 | ||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
check_urls: | ||
linkChecker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Link Checker | ||
id: lychee | ||
uses: lycheeverse/[email protected] | ||
|
||
- name: Update link tracking issue (update invalid links) | ||
if: env.lychee_exit_code != 0 | ||
uses: actions-cool/issues-helper@v3 | ||
env: | ||
FILE_CONTENT: ${{ 'cat ./lychee/out.md' }} | ||
with: | ||
actions: "update-issue" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ env.LINK_TRACKING_ISSUE_NUMBER }} | ||
state: "open" | ||
body: ${{ env.FILE_CONTENT }} | ||
update-mode: "replace" | ||
|
||
- name: Update link tracking issue (no invalid links) | ||
if: env.lychee_exit_code == 0 | ||
uses: actions-cool/issues-helper@v3 | ||
with: | ||
node-version: "18.15" | ||
cache: npm | ||
cache-dependency-path: package-lock.json | ||
- name: Install Deps | ||
run: npm install | ||
- name: Check URL | ||
run: npm run broken-link-check | ||
actions: "update-issue" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ env.link_tracking_issue_number }} | ||
state: "closed" | ||
body: "No invalid links found! 🤖" | ||
update-mode: "replace" |