-
Notifications
You must be signed in to change notification settings - Fork 690
71 lines (58 loc) · 1.63 KB
/
renew.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
name: renew
on:
workflow_dispatch:
inputs:
deploydir:
description: 'file(s) directory'
required: true
type: string
default: 'preset-lede'
dotconfig:
description: '<serial>.config file(s)'
required: true
type: string
default: '1.config, 2.config'
permissions:
contents: write
jobs:
renew:
runs-on: ubuntu-latest
env:
EXTRA_STR: _some
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.EXTRA_STR }}
- name: Carry out
env:
RENEW_PY: ${{ env.EXTRA_STR }}/extra-files/renew.py
DEPLOY_DIR: ${{ env.EXTRA_STR }}/${{ inputs.deploydir }}
DOT_CONFIG_IN: ${{ inputs.dotconfig }}
run: |
if [ ! -d "$DEPLOY_DIR" ]; then
echo "Directory $DEPLOY_DIR does not exist!"
exit 1
fi
dot_config_array=($(echo $DOT_CONFIG_IN | tr -d ' ' | tr ',' '\n'))
for dc in "${dot_config_array[@]}"; do
export DOT_CONFIG=$dc
chmod +x $RENEW_PY
$RENEW_PY
done
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.deploydir }}
path: ${{ env.EXTRA_STR }}/${{ inputs.deploydir }}
commit:
needs: renew
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: geekyeggo/delete-artifact@v5
with:
name: '*'
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: renew .config files
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>