Skip to content

Commit adfa8bf

Browse files
authored
chore: pass step outputs through env and fix workflow lint findings (#519)
1 parent 803ff9c commit adfa8bf

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "weekly"
12+
cooldown:
13+
default-days: 7
1214
open-pull-requests-limit: 10
1315
groups:
1416
actions:

‎.github/workflows/pre-commit.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
# edited: check the PR title again after it is changed
8+
types: [opened, synchronize, reopened, edited]
79
branches: [main]
810

911
permissions: {}

‎.github/workflows/release.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Release
22

33
on:
44
release:
5-
branches: [main]
65
types: [released]
76
workflow_dispatch:
87
inputs:

‎.github/workflows/self-test.yml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ jobs:
7373
extra-args: -std=c++14 -Wall
7474

7575
- name: Fail fast?!
76-
# if: steps.linter.outputs.checks-failed > 0
76+
# if: ${{ !contains(fromJSON('["0", ""]'), steps.linter.outputs.checks-failed) }}
77+
shell: bash
78+
env:
79+
CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }}
80+
TIDY_CHECKS_FAILED: ${{ steps.linter.outputs.clang-tidy-checks-failed }}
81+
FORMAT_CHECKS_FAILED: ${{ steps.linter.outputs.clang-format-checks-failed }}
7782
run: |
7883
echo "some linter checks failed"
79-
echo "total checks-failed: ${{ steps.linter.outputs.checks-failed }}"
80-
echo "clang-tidy checks-failed: ${{ steps.linter.outputs.clang-tidy-checks-failed }}"
81-
echo "clang-format checks-failed: ${{ steps.linter.outputs.clang-format-checks-failed }}"
84+
echo "total checks-failed: $CHECKS_FAILED"
85+
echo "clang-tidy checks-failed: $TIDY_CHECKS_FAILED"
86+
echo "clang-format checks-failed: $FORMAT_CHECKS_FAILED"
8287
# for actual deployment
8388
# run: exit 1
8489

@@ -127,6 +132,8 @@ jobs:
127132
step-summary: false
128133

129134
- name: Assert auto-fix committed the formatting changes
135+
env:
136+
FORMAT_CHECKS_FAILED: ${{ steps.linter.outputs.clang-format-checks-failed }}
130137
run: |
131138
set -euo pipefail
132139
@@ -164,7 +171,7 @@ jobs:
164171
exit 1
165172
fi
166173
167-
failed='${{ steps.linter.outputs.clang-format-checks-failed }}'
174+
failed="$FORMAT_CHECKS_FAILED"
168175
if [ "${failed:-0}" != "0" ]; then
169176
echo "::error title=auto-fix::clang-format still reports $failed issue(s) after auto-fix"
170177
exit 1

0 commit comments

Comments
 (0)