mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 20:11:19 +08:00
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Monthly check GitHub usernames
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 0 1 * *"
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
|
|
jobs:
|
|
check-usernames:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- run: |
|
|
cat .github/CODEOWNERS | grep -o "@[a-zA-Z0-9_-]\+" | sort -u | sed 's/@/https:\/\/api.github.com\/users\//' > usernames.txt
|
|
cat MAINTAINERS.md | grep -o "\*\*.*@[a-zA-Z0-9_-]\+.*\*\*" | grep -o "@[a-zA-Z0-9_-]\+" | sort -u | sed 's/@/https:\/\/api.github.com\/users\//' >> usernames.txt
|
|
sort -u usernames.txt -o usernames.txt
|
|
|
|
- name: Lychee URL checker
|
|
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
|
|
id: lychee
|
|
continue-on-error: true
|
|
with:
|
|
args: >-
|
|
--verbose
|
|
--no-progress
|
|
--max-concurrency 25
|
|
usernames.txt
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
- name: Find the last report issue open
|
|
uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # v2.3.0
|
|
id: last-issue
|
|
with:
|
|
state: open
|
|
labels: check usernames
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Update last report open issue created
|
|
if: steps.lychee.outcome == 'failure'
|
|
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
|
|
with:
|
|
title: GitHub usernames with errors
|
|
content-filepath: lychee/out.md
|
|
issue-number: ${{ steps.last-issue.outputs.issue-number }}
|
|
labels: check usernames
|
|
|
|
- name: Close last report open issue
|
|
if: ${{ steps.lychee.outcome == 'success' && steps.last-issue.outputs.has-found == 'true' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh issue close ${{ steps.last-issue.outputs.issue-number }}
|