Skip to content

Commit

Permalink
Repair check results (#997)
Browse files Browse the repository at this point in the history
* Update update.yml

- skip steps instead of complete job
- add job dependency

* PULL_REQUEST_TEMPLATE.md

- spell fix
  • Loading branch information
sidey79 committed Aug 2, 2021
1 parent f7c20ab commit d54e85e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!--Please specify if this is a bugfix, feature or update of docs -->
* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
- [ ] Bugfix (pleas link issue)
- [ ] Bugfix (please link issue)
- [ ] Feature enhancement
- [ ] Documentation update
- [ ] Unittest enhancement
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
BRANCH_NAME: ${{ steps.extract_branch.outputs.BRANCH_NAME }}
update:
needs: pr_check
if: needs.pr_check.outputs.result != 'true'
env:
CONTROLS_FILENAME: controls_signalduino.txt
runs-on: ubuntu-latest
steps:
- name: output
if: needs.pr_check.outputs.result != 'true'
env:
SENDER: ${{ toJson(github.event.sender) }}
PR: ${{ toJson(github.event.push) }}
Expand All @@ -52,36 +52,43 @@ jobs:
echo "$PR"
echo "$PUSHER"
- name: Extract branch name
if: needs.pr_check.outputs.result != 'true'
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Checkout Repostory
if: needs.pr_check.outputs.result != 'true'
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
persist-credentials: false
- name: update controls file (FHEM)
if: needs.pr_check.outputs.result != 'true'
uses: fhem/fhem-controls-actions@v2.0.1
with:
filename: controls_signalduino.txt
- name: update controls file (lib)
if: needs.pr_check.outputs.result != 'true'
uses: fhem/fhem-controls-actions@v2.0.1
with:
filename: controls_signalduino.txt
directory: FHEM/lib
writemode: a
- name: update CHANGED
if: needs.pr_check.outputs.result != 'true'
run: |
LOG=$(date +"%Y-%m-%d")
LOG+=" - $(git log -1 --pretty=%B)"
echo "$LOG" | cat - CHANGED > temp && mv temp CHANGED
- name: git commit back
if: needs.pr_check.outputs.result != 'true'
run: |
git config --global user.email "action@github.com"
git config --local user.name "GitHub Action"
git ls-files --error-unmatch controls_signalduino.txt || git add controls_signalduino.txt
git ls-files --error-unmatch CHANGED || git add CHANGED
git diff --name-only --exit-code controls_signalduino.txt || git commit CHANGED controls_signalduino.txt -m "Automatic updated controls and CHANGED" || true
- name: git push
if: needs.pr_check.outputs.result != 'true'
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GH_TOKEN }}
Expand Down
43 changes: 41 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,46 @@ on:
- '.github/workflows/version.yml'

jobs:
pre_ci:
name: Prepare CI environment
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2.3.4
with:
# We need to fetch with a depth of 2 for pull_request so we can do HEAD^2
fetch-depth: 2

# If this workflow was triggered by a push then resolve the commit message from HEAD
# It is stored in output steps, to be referenced with ${{ steps.push_get_commit_message.outputs.push_commit_message }}
- name: "[Push] Get commit message"
if: github.event_name == 'push'
id: push_get_commit_message
run:
echo ::set-output name=push_commit_message::$(git log --format=%B -n 1 HEAD)

# If this workflow was triggered by a pull request (open or synchronize!) then resolve the commit message from HEAD^2
# It is stored in output steps, to be referenced with ${{ steps.pr_get_commit_message.outputs.pr_commit_message }}
- name: "[Pull Request] Get commit message"
if: github.event_name == 'pull_request'
id: pr_get_commit_message
run: echo ::set-output name=pr_commit_message::$(git log --format=%B -n 1 HEAD^2)

# Finally we want to make the commit message available to other jobs. This can be done with job-level outputs
# However as we do not know whether the commit message was set in Push or Pull Request event we need to do some
# bash magic to resolve the one or the other
#
# For **Pull Request** events this will resolve to something like "$( [ -z "commit message pr" ] && echo "" || echo "commit message pr" )" which then resolves to just "commit message pr"
#
# For **Push** events this will resolve to something like "$( [ -z "" ] && echo "commit message push" || echo "" )" which then resolves to just "commit message push"
outputs:
commit_message: $( [ -z "${{ steps.pr_get_commit_message.outputs.pr_commit_message }}" ] && echo "${{ steps.push_get_commit_message.outputs.push_commit_message }}" || echo "${{ steps.pr_get_commit_message.outputs.pr_commit_message }}" )


metadata:
# Do not run this job again if the last commit was a Update Versondate which comes from this workflow!
if: "!contains(needs.pre_ci.outputs.commit_message, 'Update Versiondate')"
needs: pre_ci
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
date: ${{ steps.date.outputs.date }}
Expand Down Expand Up @@ -118,5 +157,5 @@ jobs:
- name: git push
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
github_token: ${{ secrets.GH_TOKEN }}
branch: ${{ github.head_ref }}
4 changes: 2 additions & 2 deletions FHEM/00_SIGNALduino.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: 00_SIGNALduino.pm v3.5.2 2021-07-18 20:27:24Z sidey79 $
# $Id: 00_SIGNALduino.pm v3.5.2 2021-08-01 21:18:40Z sidey79 $
#
# v3.5.2 - https://github.com/RFD-FHEM/RFFHEM/tree/master
# The module is inspired by the FHEMduino project and modified in serval ways for processing the incoming messages
Expand Down Expand Up @@ -39,7 +39,7 @@ use List::Util qw(first);


use constant {
SDUINO_VERSION => '3.5.2+20210718', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_VERSION => '3.5.2+20210801', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_INIT_WAIT_XQ => 1.5, # wait disable device
SDUINO_INIT_WAIT => 2,
SDUINO_INIT_MAXRETRY => 3,
Expand Down
2 changes: 1 addition & 1 deletion controls_signalduino.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UPD 2021-07-29_22:06:25 223871 FHEM/00_SIGNALduino.pm
UPD 2021-08-01_21:06:05 223871 FHEM/00_SIGNALduino.pm
UPD 2020-06-15_17:41:39 17876 FHEM/10_FS10.pm
UPD 2020-05-26_11:51:12 20465 FHEM/10_SD_GT.pm
UPD 2016-09-18_21:22:06 10111 FHEM/14_BresserTemeo.pm
Expand Down

0 comments on commit d54e85e

Please sign in to comment.