-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.6 KB
/
Copy pathdetect-and-build.yml
File metadata and controls
49 lines (41 loc) · 1.6 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
43
44
45
46
47
48
49
name: Detect upstream releases and trigger builds
# This workflow checks PyPI daily for new versions of tracked packages.
# When a new version is found, it triggers the build-riscv64.yml workflow
# in the corresponding fork repository.
#
# REQUIRED SECRET: DISPATCH_TOKEN
# A GitHub Personal Access Token (classic) with the following scopes:
# - repo (full control of private repositories)
# - workflow (update GitHub Action workflows)
# This is needed because GITHUB_TOKEN cannot trigger workflows in other repos.
# Create at: https://github.com/settings/tokens
# Store as: Settings > Secrets and variables > Actions > DISPATCH_TOKEN
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight UTC
workflow_dispatch:
jobs:
detect:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y jq
- name: Check for new upstream versions and trigger builds
env:
GH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
run: bash scripts/detect-and-trigger.sh
- name: Commit updated packages.json if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet packages.json; then
git add packages.json
git commit -m "chore: update package versions from upstream PyPI"
git push
else
echo "No version changes to commit."
fi