-
Notifications
You must be signed in to change notification settings - Fork 72
115 lines (99 loc) · 3.16 KB
/
Update Checker.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Copyright (c) 2019-2021 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File: .github/workflows/update-checker.yml
# Description: Source code update checker
#
name: Update Checker
env:
REPO_URL_LEDE: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
REPO_URL_SSRPLUS: https://github.com/fw876/helloworld
REPO_URL_PASSWALL: https://github.com/xiaorouji/openwrt-passwall
REPO_BRANCH_PASSWALL: main
on:
workflow_dispatch:
schedule:
- cron: 00 23 * * *
jobs:
lede:
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL_LEDE -b $REPO_BRANCH .
echo "::set-output name=commitHash::$(git rev-parse HEAD)"
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v2
with:
path: .commitHash
key: HEAD-${{ steps.getHash.outputs.commitHash }}
- name: Save New Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash
- name: Trigger build
if: steps.cacheHash.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.RELEASES_TOKEN }}
event-type: lede Source Code Update
ssrplus:
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL_SSRPLUS -b $REPO_BRANCH .
echo "::set-output name=commitHash::$(git rev-parse HEAD)"
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v2
with:
path: .commitHash
key: HEAD-${{ steps.getHash.outputs.commitHash }}
- name: Save New Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash
- name: Trigger build
if: steps.cacheHash.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.RELEASES_TOKEN }}
event-type: ssrplus Source Code Update
passwall:
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL_PASSWALL -b $REPO_BRANCH_PASSWALL .
echo "::set-output name=commitHash::$(git rev-parse HEAD)"
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v2
with:
path: .commitHash
key: HEAD-${{ steps.getHash.outputs.commitHash }}
- name: Save New Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash
- name: Trigger build
if: steps.cacheHash.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.RELEASES_TOKEN }}
event-type: passwall Source Code Update
- name: Delete workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 1