mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-16 18:01:34 +00:00
fix: composite action input pollution (#818)
refuses to use the default for an nodejs input when an composite action has an input with the same name. clean cherry-pick (except for trivial context conflict) of two related pull requests - https://github.com/nektos/act/pull/2348 - https://github.com/nektos/act/pull/2473 <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/818): <!--number 818 --><!--line 0 --><!--description Zml4OiBjb21wb3NpdGUgYWN0aW9uIGlucHV0IHBvbGx1dGlvbg==-->fix: composite action input pollution<!--description--> <!--end release-notes-assistant--> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/818 Reviewed-by: Gusted <gusted@noreply.code.forgejo.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
931c2c0ac3
commit
b236cb64f9
18 changed files with 267 additions and 4 deletions
47
act/runner/testdata/uses-composite-check-for-input-in-if-uses/composite_action/action.yml
vendored
Normal file
47
act/runner/testdata/uses-composite-check-for-input-in-if-uses/composite_action/action.yml
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
name: "Test Composite Action"
|
||||
description: "Test action uses composite"
|
||||
|
||||
inputs:
|
||||
b:
|
||||
default: true
|
||||
b2: {}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: https://github.com/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: https://github.com/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: https://github.com/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: https://github.com/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
act/runner/testdata/uses-composite-check-for-input-in-if-uses/push.yml
vendored
Normal file
24
act/runner/testdata/uses-composite-check-for-input-in-if-uses/push.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
name: uses-composite-check-for-input-in-if-uses
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/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
|
Loading…
Add table
Add a link
Reference in a new issue