Workflow names now match their file stems, so the Actions list and the files read the same; generate-deps-relation-r1.yml becomes deps-table.yml after the branch it maintains. Steps are lowercase and verb-first, every step is named, and the autobump-rb checkout has one name everywhere. Also use 4-space step indentation, fromJSON, bare if: expressions, github.actor for every ghcr login, uppercase env names, and the GITHUB_REPOSITORY and GITHUB_REPOSITORY_OWNER variables the runner already sets instead of REPO and OWNER copies. No behaviour changes. Signed-off-by: Zakk <zakk@gentoozh.org>
42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
name: fleet-keeper
|
|
|
|
# Vendor forks can lose their schedules after 60 days without commits.
|
|
on:
|
|
schedule:
|
|
- cron: '30 5 * * 1'
|
|
workflow_dispatch:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
keep:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: mint gentoo-zh-drafts token
|
|
uses: actions/create-github-app-token@v3
|
|
id: app-token
|
|
with:
|
|
client-id: ${{ secrets.DRAFTS_BOT_CLIENT_ID }}
|
|
private-key: ${{ secrets.DRAFTS_BOT_PRIVATE_KEY }}
|
|
owner: gentoo-zh-drafts
|
|
|
|
- name: re-enable inactivity-disabled fork schedules
|
|
env:
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
run: |
|
|
seen=0; enabled=0
|
|
repos=$(gh repo list gentoo-zh-drafts --limit 300 --json name -q '.[].name')
|
|
for repo in $repos; do
|
|
ids=$(gh api "repos/gentoo-zh-drafts/$repo/actions/workflows" \
|
|
--jq '.workflows[] | select(.state == "disabled_inactivity") | .id')
|
|
for id in $ids; do
|
|
seen=$((seen + 1))
|
|
if gh api -X PUT "repos/gentoo-zh-drafts/$repo/actions/workflows/$id/enable" >/dev/null 2>&1; then
|
|
enabled=$((enabled + 1)); echo "re-enabled $repo"
|
|
else
|
|
echo "::warning title=fleet-keeper::could not re-enable $repo (workflow $id)"
|
|
fi
|
|
done
|
|
done
|
|
echo "frozen found: $seen, re-enabled: $enabled" | tee -a "$GITHUB_STEP_SUMMARY"
|