forked from pacstall/chaotic-PPR
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.16 KB
/
ppr-watchdog.yml
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: Watchdog
permissions:
contents: write
pull-requests: write
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
push:
branches:
- master
jobs:
update-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
- name: Check for updates from API
run: |
needed=0
updates="$(./scripts/checker.sh updates packages.json)"
if [[ "${updates}" == "No PPR updates found." ]]; then
echo "No PPR updates found."
echo "needed=0" >> $GITHUB_ENV
exit 0
else
echo "needed=1" >> $GITHUB_ENV
echo "pr_body<<EOF" >> $GITHUB_ENV
echo "${updates}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.needed == '1'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: packages.json
base: master
branch: watchdog
title: "Bump timestamps from API"
body: "${{ env.pr_body }}"