-
-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (41 loc) · 1.25 KB
/
update.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
# for each folder in ultramarine/
# if there is chkupdate.py
# run it every 2 hours
name: Automatically check for updates
on:
schedule:
- cron: "0 */2 * * *"
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:37
options: --cap-add=SYS_ADMIN --privileged
outputs:
updated: ${{ steps.save.outputs.updated }}
steps:
- name: Install packages
run: dnf install -y rpmdevtools git python
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Run Update
run: bash ./update.sh
- name: Save
id: save
run: |
git config --global --add safe.directory "*"
if [[ `git status --porcelain` ]]; then
git config user.name "Package Update Checker"
git config user.email "<>"
git status | grep modified | sed -r "s@.+/([^/]+)/[^/]+\n?@\1 @g" | tr -d '\n' > $m
git commit -a -m "Automatic Update: $m"
git push -u origin main
echo "updated=1" >> $GITHUB_OUTPUT
fi
autobuild:
needs: autoupdate
if: needs.autoupdate.outputs.updated
uses: ./.github/workflows/autobuild.yml