-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: if condition in composite action misbehaves (#2473)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
bb9f36d
commit 5ffec84
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
pkg/runner/testdata/uses-composite-check-for-input-in-if-uses/composite_action/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Test Composite Action" | ||
description: "Test action uses composite" | ||
|
||
inputs: | ||
b: | ||
default: true | ||
b2: {} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v7 | ||
if: inputs.b == 'true' | ||
with: | ||
script: | | ||
console.log(${{ tojson(inputs) }}) | ||
if( ${{ tojson(inputs.b) }} != 'true' ) { | ||
process.exit(-1); | ||
} | ||
github-token: noop | ||
- uses: actions/github-script@v7 | ||
if: inputs.b != 'true' | ||
with: | ||
script: | | ||
console.log(${{ tojson(inputs) }}) | ||
if( ${{ tojson(inputs.b) }} == 'true' ) { | ||
process.exit(-1); | ||
} | ||
github-token: noop | ||
- uses: actions/github-script@v7 | ||
if: inputs.b2 == 'false' | ||
with: | ||
script: | | ||
console.log(${{ tojson(inputs) }}) | ||
if( ${{ tojson(inputs.b2) }} != 'false' ) { | ||
process.exit(-1); | ||
} | ||
github-token: noop | ||
- uses: actions/github-script@v7 | ||
if: inputs.b2 != 'false' | ||
with: | ||
script: | | ||
console.log(${{ tojson(inputs) }}) | ||
if( ${{ tojson(inputs.b2) }} == 'false' ) { | ||
process.exit(-1); | ||
} | ||
github-token: noop |
24 changes: 24 additions & 0 deletions
24
pkg/runner/testdata/uses-composite-check-for-input-in-if-uses/push.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: uses-composite-check-for-input-in-if-uses | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./uses-composite-check-for-input-in-if-uses/composite_action | ||
with: | ||
b: true | ||
b2: true | ||
- uses: ./uses-composite-check-for-input-in-if-uses/composite_action | ||
with: | ||
b: false | ||
b2: false | ||
- uses: ./uses-composite-check-for-input-in-if-uses/composite_action | ||
with: | ||
b: true | ||
b2: false | ||
- uses: ./uses-composite-check-for-input-in-if-uses/composite_action | ||
with: | ||
b: false | ||
b2: true |