mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2026-05-16 12:57:40 +02:00
Bumps [actions/github-script](https://github.com/actions/github-script) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](ed597411d8...3a2844b7e9)
---
updated-dependencies:
- dependency-name: actions/github-script
dependency-version: 9.0.0
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
90 lines
2.9 KiB
Markdown
90 lines
2.9 KiB
Markdown
name: Broken Links Report
|
|
|
|
on:
|
|
schedule:
|
|
- 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
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # ratchet:actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build
|
|
run: go build -o awesome-docker ./cmd/awesome-docker
|
|
|
|
- name: Run Link Check
|
|
id: link_check
|
|
run: ./awesome-docker ci broken-links --issue-file broken_links_issue.md --github-output "$GITHUB_OUTPUT"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create/Update Issue for Broken Links
|
|
if: steps.link_check.outputs.has_errors == 'true'
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # ratchet:actions/github-script@v9.0.0
|
|
with:
|
|
script: |
|
|
const fs = require('fs');
|
|
const issueBody = fs.readFileSync('broken_links_issue.md', 'utf8');
|
|
|
|
const issues = await github.rest.issues.listForRepo({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
state: 'open',
|
|
labels: 'broken-links',
|
|
per_page: 1
|
|
});
|
|
|
|
if (issues.data.length > 0) {
|
|
await github.rest.issues.update({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: issues.data[0].number,
|
|
body: issueBody
|
|
});
|
|
} else {
|
|
await github.rest.issues.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
title: 'Broken Links Detected',
|
|
body: issueBody,
|
|
labels: ['broken-links', 'bug']
|
|
});
|
|
}
|
|
|
|
- name: Close Issue if No Errors
|
|
if: steps.link_check.outputs.has_errors == 'false'
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # ratchet:actions/github-script@v9.0.0
|
|
with:
|
|
script: |
|
|
const issues = await github.rest.issues.listForRepo({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
state: 'open',
|
|
labels: 'broken-links',
|
|
per_page: 1
|
|
});
|
|
if (issues.data.length > 0) {
|
|
await github.rest.issues.update({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: issues.data[0].number,
|
|
state: 'closed',
|
|
state_reason: 'completed'
|
|
});
|
|
}
|