Skip to content

Commit 971c733

Browse files
authored
Don't write the failure string when skipping (#220)
* Don't write the failure string when skipping * Fix bash command * Don't exit with 4 * Test not checking for changelog * Test removing changelog from health defaults * Add debug steps * Switch changelog if clause syntax * Fix all * Revert debug changes * Revert "Test removing changelog from health defaults" This reverts commit c9836e0. * Remove changelog * Remove debug change
1 parent 1e2785d commit 971c733

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/health.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ on:
8686

8787
jobs:
8888
version:
89-
if: contains(${{ inputs.checks }}, 'version')
89+
if: ${{ contains(inputs.checks, 'version') }}
9090
uses: ./.github/workflows/health_base.yaml
9191
with:
9292
sdk: ${{ inputs.sdk }}
@@ -97,7 +97,7 @@ jobs:
9797
use-flutter: ${{ inputs.use-flutter }}
9898

9999
changelog:
100-
if: contains(${{ inputs.checks }}, 'changelog')
100+
if: ${{ contains(inputs.checks, 'changelog') }}
101101
uses: ./.github/workflows/health_base.yaml
102102
with:
103103
sdk: ${{ inputs.sdk }}
@@ -108,7 +108,7 @@ jobs:
108108
use-flutter: ${{ inputs.use-flutter }}
109109

110110
license:
111-
if: contains(${{ inputs.checks }}, 'license')
111+
if: ${{ contains(inputs.checks, 'license') }}
112112
uses: ./.github/workflows/health_base.yaml
113113
with:
114114
sdk: ${{ inputs.sdk }}
@@ -119,7 +119,7 @@ jobs:
119119
use-flutter: ${{ inputs.use-flutter }}
120120

121121
coverage:
122-
if: contains(${{ inputs.checks }}, 'coverage')
122+
if: ${{ contains(inputs.checks, 'coverage') }}
123123
uses: ./.github/workflows/health_base.yaml
124124
with:
125125
sdk: ${{ inputs.sdk }}
@@ -132,7 +132,7 @@ jobs:
132132
use-flutter: ${{ inputs.use-flutter }}
133133

134134
breaking:
135-
if: contains(${{ inputs.checks }}, 'breaking')
135+
if: ${{ contains(inputs.checks, 'breaking') }}
136136
uses: ./.github/workflows/health_base.yaml
137137
with:
138138
sdk: ${{ inputs.sdk }}
@@ -143,7 +143,7 @@ jobs:
143143
use-flutter: ${{ inputs.use-flutter }}
144144

145145
do-not-submit:
146-
if: contains(${{ inputs.checks }}, 'do-not-submit')
146+
if: ${{ contains(inputs.checks, 'do-not-submit') }}
147147
uses: ./.github/workflows/health_base.yaml
148148
with:
149149
sdk: ${{ inputs.sdk }}

.github/workflows/health_base.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ jobs:
7171
path: base_repo/
7272
if: ${{ inputs.check == 'coverage' }} || ${{ inputs.check == 'breaking' }}
7373

74-
- name: Write comment if not present
75-
run: |
76-
mkdir -p current_repo/output/
77-
test -f current_repo/output/comment.md || echo $'The ${{ inputs.check }} workflow has encountered an exception and did not complete.' >> current_repo/output/comment.md
74+
- run: mkdir -p current_repo/output/
7875

7976
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
8077
if: ${{ inputs.use-flutter }}
@@ -109,7 +106,16 @@ jobs:
109106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110107
ISSUE_NUMBER: ${{ github.event.number }}
111108
PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}"
112-
run: cd current_repo/ && dart pub global run firehose:health --check ${{ inputs.check }} ${{ fromJSON('{"true":"--coverage_web","false":""}')[inputs.coverage_web] }} --fail_on ${{ inputs.fail_on }} --warn_on ${{ inputs.warn_on }}
109+
run: |
110+
cd current_repo/
111+
dart pub global run firehose:health \
112+
--check ${{ inputs.check }} \
113+
${{ fromJSON('{"true":"--coverage_web","false":""}')[inputs.coverage_web] }} \
114+
--fail_on ${{ inputs.fail_on }} \
115+
--warn_on ${{ inputs.warn_on }}
116+
117+
- run: test -f current_repo/output/comment.md || echo $'The ${{ inputs.check }} workflow has encountered an exception and did not complete.' >> current_repo/output/comment.md
118+
if: ${{ '$action_state' == 1 }}
113119

114120
- name: Upload coverage to Coveralls
115121
if: ${{ inputs.upload_coverage }}

0 commit comments

Comments
 (0)