generated from P3TERX/Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.37 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
#
# https://github.com/P3TERX/Actions-OpenWrt
#
# File: .github/workflows/update-checker.yml
# Description: Source code update checker
#
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Update Checker
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
on:
workflow_dispatch:
# schedule:
# - cron: 0 */18 * * *
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH .
echo "commitHash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v3
with:
path: .commitHash
key: commitHash_${{ 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@v2
with:
token: ${{ github.token }}
event-type: Source Code Update
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 0
keep_minimum_runs: 2