From d54e85e5eb0bce005543d635366c8a01b33da6fe Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 2 Aug 2021 22:20:06 +0200 Subject: [PATCH] Repair check results (#997) * Update update.yml - skip steps instead of complete job - add job dependency * PULL_REQUEST_TEMPLATE.md - spell fix --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/update.yml | 9 ++++++- .github/workflows/version.yml | 43 ++++++++++++++++++++++++++++++-- FHEM/00_SIGNALduino.pm | 4 +-- controls_signalduino.txt | 2 +- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 70d3051fc..b564422ea 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ * **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 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 4baca05cf..455465b50 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -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) }} @@ -52,29 +52,35 @@ 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" @@ -82,6 +88,7 @@ jobs: 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 }} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 5473e85d0..c86620993 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -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 }} @@ -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 }} \ No newline at end of file + github_token: ${{ secrets.GH_TOKEN }} + branch: ${{ github.head_ref }} diff --git a/FHEM/00_SIGNALduino.pm b/FHEM/00_SIGNALduino.pm index c10e72d49..d8b81ec9e 100644 --- a/FHEM/00_SIGNALduino.pm +++ b/FHEM/00_SIGNALduino.pm @@ -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 @@ -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, diff --git a/controls_signalduino.txt b/controls_signalduino.txt index ce23e7bf4..f7ea550b0 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -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