-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (39 loc) · 1.27 KB
/
update.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
name: controlsFile
on:
push:
paths:
- 'FHEM/**'
- '.github/workflows/update.yml'
jobs:
update:
env:
CONTROLS_FILENAME: controls_rsl.txt
runs-on: ubuntu-latest
steps:
- name: Extract branch name
id: extract_branch
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
- name: Checkout Repostory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: update controls files
uses: fhem/fhem-controls-actions@v2
with:
filename: controls_rsl.txt
- name: update CHANGED
run: |
LOG=$(date +"%Y-%m-%d")
LOG+=" - $(git log -1 --pretty=%B)"
echo "$LOG" | cat - CHANGED > temp && mv temp CHANGED
- name: git commit back
run: |
git config --global user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CHANGED controls_rsl.txt || true
git log -1 --name-only --pretty=format: | grep -Eo '[0-9]{2}_.*.pm$' && git commit CHANGED controls_rsl.txt -m "Automaitc updated controls and CHANGED" || true
- name: Push to branch
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}