-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (36 loc) · 1.11 KB
/
fetch-releases.yml
File metadata and controls
42 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Fetch New Releases
on:
schedule:
# Run daily at 5:00 AM UTC (after stars at 2 AM, activity at 4 AM, before deploy at 6 AM)
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (do not commit changes)'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
fetch-releases:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch new releases
id: fetch
run: .github/scripts/fetch-releases.sh
- name: Commit and push if changed
if: ${{ !inputs.dry_run }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add content/releases/
if git diff --staged --quiet; then
echo "No new releases to commit"
else
NEW_COUNT=$(git diff --staged --name-only | wc -l)
git commit -m "chore: add ${NEW_COUNT} new release(s) [skip ci]"
git push
fi