check-links: add pipeline to check all links (#130) #1258
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
name: Calculate Metrics | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
calculate-metrics: | |
runs-on: ubuntu-latest | |
name: Calculate Metrics | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: true | |
- uses: actions/setup-python@v5 | |
if: github.ref == 'refs/heads/main' | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install npm dependencies | |
run: npm install -g markdownlint-cli tldr-lint | |
- name: Install pip dependencies | |
if: github.ref == 'refs/heads/main' | |
run: pip install -r requirements.txt && rm -f requirements.txt | |
- name: Run the script and generate artifacts | |
run: ./scripts/calculate-metrics.sh 2>&1 | tee metrics.log | |
- name: Upload Calculate Metrics artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: metrics | |
path: | | |
metrics.log | |
*.txt | |
check-pages*/ | |
- name: Create metrics.zip | |
if: github.ref == 'refs/heads/main' | |
run: zip -r metrics.zip metrics.log *.txt check-pages*/ | |
- name: Upload artifacts to GitHub Release | |
if: github.ref == 'refs/heads/main' | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: latest | |
files: | | |
metrics.log | |
*.txt | |
metrics.zip | |
- name: Update Translation Dashboard Status Issue | |
if: github.repository == 'tldr-pages/tldr-maintenance' && github.ref == 'refs/heads/main' | |
run: python3 scripts/update-dashboard-issue.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update Language-specific Translation Dashboard Status Issues | |
if: github.repository == 'tldr-pages/tldr-maintenance' && github.ref == 'refs/heads/main' | |
run: python3 scripts/update-language-issues.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |