-
Notifications
You must be signed in to change notification settings - Fork 36
62 lines (52 loc) · 1.7 KB
/
update-checker-padavanonly.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
name: Update Checker padavanonly
env:
REPO_URL: https://github.com/padavanonly/immortalwrtARM
REPO_BRANCH: mt7981
on:
workflow_dispatch:
# schedule:
# - cron: 0 14 * * 2,4,6
jobs:
check:
runs-on: ubuntu-22.04
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH .
git log --name-only >> text.txt
echo "commitHash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v3
with:
path: .commitHash
key: HEAD-padavanonly-${{ 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: Email notification
uses: dawidd6/action-send-mail@master
if: steps.cacheHash.outputs.cache-hit != 'true' && !cancelled()
with:
server_address: smtp.163.com
server_port: 465
username: ${{ secrets.MAILUSERNAME }}
password: ${{ secrets.MAILPASSWORD }}
subject: padavanonly update source code
body: file://text.txt
to: ${{ secrets.MAIL }}
from: GitHub Actions For Checking Update
content_type: text/html
# - name: Trigger build
# if: steps.cacheHash.outputs.cache-hit != 'true'
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.ACTIONS_TRIGGER_PAT }}
# event-type: Source Code Update
- name: Delete workflow runs
uses: FunctionXJB/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 2