Skip to content

Commit b1b635d

Browse files
wadellszgosalvez
andauthored
Fix "last step wins" error (#132)
* Add a test case that has a pinned action after an un-pinned one Whether the job fails or not was being overwritten by the last step in the job. If the last step is pinned, this would cause the check to pass, even if an earlier step was unpinned. Now we have a test case that exercises this functionality. * Fail the job if any steps have errors Previously this logic only failed the job if the last step had an error. * Run npm prepare --------- Co-authored-by: Zennon Gosalvez <[email protected]>
1 parent 0cee947 commit b1b635d

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function run() {
3737
jobHasError = runAssertions(uses, allowlist, isDryRun);
3838
} else if (steps !== undefined) {
3939
for (const step of steps) {
40-
jobHasError = runAssertions(step['uses'], allowlist, isDryRun);
40+
jobHasError ||= runAssertions(step['uses'], allowlist, isDryRun);
4141
}
4242
} else {
4343
core.warning(`The "${job}" job of the "${basename}" workflow does not contain uses or steps.`);

test/stub/unpinned/file.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ jobs:
66
steps:
77
- uses: docker://rhysd/actionlint:latest
88
- uses: docker://rhysd/actionlint:1.6.22
9+
mixedstub:
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
13+

0 commit comments

Comments
 (0)