Automatic updated controls and CHANGED #41
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: CI | |
on: [push] | |
jobs: | |
update: | |
env: | |
CONTROLS_FILENAME: controls_BRAVIA.txt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract branch name | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Checkout Repostory | |
uses: actions/checkout@master | |
- name: update controls files | |
uses: fhem/fhem-controls-actions@main | |
with: | |
filename: controls_BRAVIA.txt | |
- name: update CHANGED | |
run: | | |
GREP_AUTO_UPDATE="Automatic updated controls and CHANGED" | |
GREP_MERGE_BRANCH="Merge branch" | |
GREP_SVN_UPLOAD="SVN upload" | |
GREP_UPDATE_YML="update.yml" | |
LOG=$(git log --pretty="%as - %s" --invert-grep --grep="$GREP_AUTO_UPDATE" --grep="$GREP_MERGE_BRANCH" --grep="$GREP_SVN_UPLOAD" --grep="$GREP_UPDATE_YML") | |
echo "$LOG" | cat - CHANGED | grep . > 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_BRAVIA.txt || true | |
git log -1 --name-only --pretty=format: | grep -Eo '[0-9]{2}_.*.pm$' && git commit CHANGED controls_BRAVIA.txt -m "Automatic updated controls and CHANGED" || true | |
- name: git push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ steps.extract_branch.outputs.branch }} |