diff --git a/.github/workflows/check-external-links.yml b/.github/workflows/check-external-links.yml index 58e55053..a134d7b1 100644 --- a/.github/workflows/check-external-links.yml +++ b/.github/workflows/check-external-links.yml @@ -11,34 +11,36 @@ jobs: permissions: issues: write steps: + - uses: actions/checkout@v4 - name: Restore lychee cache uses: actions/cache@v4 with: path: .lycheecache - key: cache-lychee-${{ github.sha }} + key: cache-lychee-${{ hashFiles('lychee.toml') }} restore-keys: cache-lychee- - - uses: actions/checkout@v4 - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v2 with: lycheeVersion: "latest" args: | - --cache - --verbose - --accept '100..=103,200..=299,400,403' - --base https://dev.flare.network/ - --no-progress - --insecure - --exclude '^(/|https://dev\.flare\.network/|https?://localhost(?::[0-9]+)?/|https://fdc-verifiers-testnet\.flare\.network/|https://github\.com/flare-foundation/flare-hardhat-starter/|https://github\.com/flare-foundation/flare-foundry-starter/|https://sepolia\.etherscan\.io/|https://metamask\.io/|https://openweathermap\.org/|https://www\.gnu\.org/)' + --config lychee.toml . fail: true env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Create Issue From File + - name: Comment on PR if broken links found if: steps.lychee.outputs.exit_code != 0 - uses: peter-evans/create-issue-from-file@v5 + uses: thollander/actions-comment-pull-request@v3 with: - title: Link Checker Report - content-filepath: ./lychee/out.md - labels: report, automated issue + message: | + ### 🚨 Broken links detected +
+ Click to expand + + ```markdown + ${{ steps.lychee.outputs.report }} + ``` +
+ env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 7b9fc5c7..cbdfc39d 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ yarn-error.log* .vscode .idea +.lycheecache flare-smart-contracts-v2/ flare-smart-contracts/ diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 00000000..d492a905 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,18 @@ +base_url = "https://dev.flare.network/" +verbose = "info" +cache = true +accept = ["200", "429", "403"] +no_progress = true +exclude = [ + '^/', + 'https://dev\.flare\.network/', + 'https?://localhost(?::[0-9]+)?/', + 'https://fdc-verifiers-testnet\.flare\.network/', + 'https://github\.com/flare-foundation/flare-hardhat-starter/', + 'https://github\.com/flare-foundation/flare-foundry-starter/', + 'https://sepolia\.etherscan\.io/', + 'https://metamask\.io/', + 'https://openweathermap\.org/', + 'https://www\.gnu\.org/', + 'https://swapi\.dev/', +]