Bump actions/checkout from 3 to 4 #131
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |