Skip to content

Commit

Permalink
chore(ci): clean links checker (#3857)
Browse files Browse the repository at this point in the history
* chore(ci): clean links checker

* nit

* dprint

* pass token as input
  • Loading branch information
thibault-martinez authored Nov 4, 2024
1 parent 8b9e846 commit ba5c61d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/_cargo_deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
with:
tool: cargo-deny
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check bans licenses sources

advisories:
name: cargo deny (advisories)
runs-on: [self-hosted]
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- cron: "0 0 * * *"

jobs:
link_checker:
links-checker:
name: Check links and create automated issue if needed
runs-on: self-hosted
env:
Expand All @@ -20,8 +20,9 @@ jobs:

- name: Check all links at *.md and doc files
id: lychee
uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 # pin@v1.8.0
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # pin@v1.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
output: ${{ env.LYCHEE_OUT }}
format: markdown
## Do not fail this step on broken links
Expand All @@ -35,42 +36,23 @@ jobs:
--max-concurrency 10
--no-progress
'./**/*.md'
env:
## Avoid rate limiting when checking github.com links
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Find the last report issue open
uses: micalevisk/last-issue-action@305829d9728f47beb0029417167a0af890edfd6e # [email protected]
id: last_issue
with:
state: open
labels: |
report
automated issue
labels: broken-links
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create issue from report file
if: steps.last_issue.outputs.has_found == 'false'
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # pin@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
- name: Update last report open issue created
if: steps.last_issue.outputs.has_found == 'true'
- name: Create or update report
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # pin@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
labels: broken-links

- name: Close last report open issue
if: steps.lychee.outputs.exit_code == 0
Expand Down

0 comments on commit ba5c61d

Please sign in to comment.