Files
packages/.github/workflows/update.yml
T
2022-11-28 00:22:29 +08:00

45 lines
1.2 KiB
YAML

# for each folder in ultramarine/
# if there is chkupdate.py
# run it every 2 hours
name: Automatically check for updates
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:37
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Install packages
run: dnf install -y rpmdevtools git python anda
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
token: ${{ secrets.PAT }}
- name: Run Update (Python)
run: bash ./update.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Update (anda)
run: anda update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 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 commit -a -m "Automatic Update: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')"
git push -u origin main
fi