Add ci subcommands and simplify scheduled workflows

This commit is contained in:
Julien Bisconti
2026-02-28 01:44:56 +01:00
parent c14a071c8d
commit 9a5331398d
3 changed files with 420 additions and 159 deletions

View File

@@ -5,9 +5,14 @@ on:
- cron: "0 2 * * 6"
workflow_dispatch:
concurrency:
group: broken-links-${{ github.ref }}
cancel-in-progress: false
jobs:
check-links:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
issues: write
@@ -24,22 +29,7 @@ jobs:
- name: Run Link Check
id: link_check
run: |
set +e
./awesome-docker check > link_check_output.txt 2>&1
exit_code=$?
set -e
has_errors=false
if [ "$exit_code" -ne 0 ]; then
has_errors=true
fi
if grep -qi "broken links" link_check_output.txt; then
has_errors=true
fi
echo "has_errors=$has_errors" >> "$GITHUB_OUTPUT"
echo "check_exit_code=$exit_code" >> "$GITHUB_OUTPUT"
run: ./awesome-docker ci broken-links --issue-file broken_links_issue.md --github-output "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -49,10 +39,7 @@ jobs:
with:
script: |
const fs = require('fs');
const output = fs.readFileSync('link_check_output.txt', 'utf8');
const exitCode = '${{ steps.link_check.outputs.check_exit_code }}';
const issueBody = `# Broken Links Detected\n\nThe weekly link check found broken links or the checker failed to execute cleanly.\n\nChecker exit code: ${exitCode}\n\n\`\`\`\n${output}\n\`\`\`\n\n## Action Required\n\n- Update the URL if the resource moved\n- Remove the entry if permanently unavailable\n- Add to \`config/exclude.yaml\` if a known false positive\n- Investigate checker failures when exit code is non-zero\n\n---\n*Auto-generated by broken_links.yml*`;
const issueBody = fs.readFileSync('broken_links_issue.md', 'utf8');
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,