diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35cf97f..673eb21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,20 +4,22 @@ jobs: test: runs-on: ubuntu-latest env: - node_version: 18.4.0 + expected: |- + here is some "text". this is not a newline: [\n] steps: - name: Checkout uses: actions/checkout@v3 - name: Dynamic Use - uses: ./../dynamic-uses - id: setup_node + uses: ./. + id: parrot with: - uses: "${{ 'actions/setup-node@v3' }}" - with: '{ "node-version": "${{ env.node_version }}" }' + uses: ./.github/workflows/test + with: | + { "echo": ${{ toJSON(env.expected) }} } - name: Validate outputs + env: + actual: ${{ fromJSON(steps.parrot.outputs.outputs).echo }} run: | - expected="v${node_version}" - actual="${{ fromJSON(steps.setup_node.outputs.outputs)['node-version'] }}" if [[ "$expected" != "$actual" ]]; then echo "::error::output mismatch! expected=$expected, actual=$actual" exit 1 diff --git a/.github/workflows/test/action.yml b/.github/workflows/test/action.yml new file mode 100644 index 0000000..b6b9e3f --- /dev/null +++ b/.github/workflows/test/action.yml @@ -0,0 +1,17 @@ +name: echo action +description: return the input as an output +inputs: + echo: + description: what should i say? + required: true +outputs: + echo: + description: what i said + value: ${{ inputs.echo }} +runs: + using: composite + steps: + - env: + echo: ${{ inputs.echo }} + run: echo "$echo" + shell: bash \ No newline at end of file