-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.39 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
name: Check Update of Packages
on:
schedule:
- cron: '0 0 */3 * *'
workflow_dispatch:
inputs:
package:
description: 'package to check'
jobs:
updatecheck:
runs-on: ubuntu-latest
container:
image: ghcr.io/eweos/docker:updatecheck
steps:
- name: Restore cache
run: |
mkdir -p ~/.cache/archversion
echo "{}" > ~/.cache/archversion/packages.cache
wget https://raw.githubusercontent.com/eweOS/updatecheck/master/result.json -O ~/.cache/archversion/packages.cache
- name: Check for updates (all)
if: ${{ github.event.inputs.package == '' }}
run: eweversion check
- name: Check for updates (single)
if: ${{ github.event.inputs.package != '' }}
run: eweversion check ${{ github.event.inputs.package }}
- name: Collect result
run: |
mkdir -p ~/checkresult
cp ~/.cache/archversion/packages.cache ~/checkresult/result.json
- name: Deploy result
run: |
cd ~/checkresult
git init
git config --global user.name 'eweOS Update Checker'
git config --global user.email 'nobody.noreply@ewe.moe'
git add result.json
git remote add github https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/eweOS/updatecheck
git commit -m "Update package list"
git push github HEAD:master -f