generated from P3TERX/Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (59 loc) · 2.08 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
#
# Copyright (c) 2019-2022 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: 更新检查
on:
workflow_dispatch:
schedule:
- cron: 20 2 */3 * *
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: 获取Commit Hash
id: getHash
run: |
git clone --depth 1 https://github.com/coolsnowwolf/lede -b master lede
cd lede
echo "commitHash_Lede=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
cd
git clone --depth 1 https://github.com/coolsnowwolf/packages -b master ledepackage
cd ledepackage
echo "commitHash_Lede_Package=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
cd
git clone --depth 1 https://github.com/coolsnowwolf/luci -b master luci
cd luci
echo "commitHash_Lede_Luci=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
cd
- name: 整理Hash
id: combHeader
run: |
echo "commitHash_All=${{steps.getHash.outputs.commitHash_Lede}},${{steps.getHash.outputs.commitHash_Lede_Package}},${{steps.getHash.outputs.commitHash_Lede_Luci}} " >> $GITHUB_OUTPUT
- name: 对比Commit Hash
id: cacheHash
uses: actions/cache@v3
with:
path: .commitHash_All
key: HEAD-${{steps.combHeader.outputs.commitHash_All}}
- name: 保存新的Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.combHeader.outputs.commitHash_All }} | tee .commitHash_All
- name: 删除运行记录
uses: naoki66/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 1
- name: 触发编译
if: steps.cacheHash.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@main
with:
token: ${{ secrets.ACTIONS_TRIGGER_PAT }}
event-type: 上游源码更新触发编译