Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract unstable lychee action from other linters #1061

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/check-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🔗
# Extracted from other linters.
# This action is bit slow and much unstable because of depending to external resources.
on:
push:
branches: [main]
paths:
- '.github/workflows/check-link.yml'
pull_request:
paths:
- '.github/workflows/check-link.yml'
workflow_dispatch:
schedule:
# Every 10:42 on Tuesday JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 1 * * 2'

jobs:
# Don't use lycheeverse/lychee-action. There is no benefit rather than using the CLI for my use. And considering the targets should be simple with `git ls-files` rather than built-in glob
lychee:
runs-on: ubuntu-24.04
env:
CLI_VERSION: '0.18.0' # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["lychee", "--version"], "nth": 2}
steps:
- uses: actions/checkout@v4
- name: Install
run: |
curl -OL 'https://github.com/lycheeverse/lychee/releases/download/lychee-v${{ env.CLI_VERSION }}/lychee-x86_64-unknown-linux-gnu.tar.gz'
tar zxvf lychee-x86_64-unknown-linux-gnu.tar.gz
mkdir --parents /home/runner/.lychee/bin
mv lychee /home/runner/.lychee/bin
echo '/home/runner/.lychee/bin' >> $GITHUB_PATH
- name: Run
env:
# Not GH_TOKEN for lychee.
# https://github.com/lycheeverse/lychee/blob/fc006bddc5a63067895799b83cbb9a4cbcabca6a/lychee-bin/src/options.rs#L459-L462
GITHUB_TOKEN: ${{ github.token }}
# Don't use glob. It often ignores .gitignore (why?)
run: |
git ls-files '*.md' '*.nix' | xargs lychee --
23 changes: 0 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,3 @@ jobs:
.
.github
.vscode

# Don't use lycheeverse/lychee-action. There is no benefit rather than using the CLI for my use. And considering the targets should be simple with `git ls-files` rather than built-in glob
link-checker:
runs-on: ubuntu-24.04
env:
CLI_VERSION: '0.18.0' # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["lychee", "--version"], "nth": 2}
steps:
- uses: actions/checkout@v4
- name: Install
run: |
curl -OL 'https://github.com/lycheeverse/lychee/releases/download/lychee-v${{ env.CLI_VERSION }}/lychee-x86_64-unknown-linux-gnu.tar.gz'
tar zxvf lychee-x86_64-unknown-linux-gnu.tar.gz
mkdir --parents /home/runner/.lychee/bin
mv lychee /home/runner/.lychee/bin
echo '/home/runner/.lychee/bin' >> $GITHUB_PATH
- name: Run
env:
# Not GH_TOKEN for lychee.
# https://github.com/lycheeverse/lychee/blob/fc006bddc5a63067895799b83cbb9a4cbcabca6a/lychee-bin/src/options.rs#L459-L462
GITHUB_TOKEN: ${{ github.token }}
# Don't use glob. It often ignores .gitignore (why?)
run: |
git ls-files '*.md' '*.nix' | xargs lychee --