1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-10-20 19:52:06 +00:00
forgejo-runner/act
Mathieu Fenniak 02247b852a fix: allow mapping into env variable INPUT_N from ${{ inputs.n }} (#1080)
When using a reusable workflow such as:
```yaml
name: "use-inputs-impl"

on:
  workflow_call:
    inputs:
      image:
        description: "Image to be used in job"
        type: string
        required: false
        default: "docker.io/alpine:3.22"
      condition:
        description: "Only run a job if this is true"
        type: string
        required: false
        default: false

jobs:
  works:
    runs-on: docker
    container:
      image: alpine:3.22
    env:
      INPUT_IMAGE: ${{ inputs.image }}
      INPUT_CONDITION: ${{ inputs.condition }}
    steps:
      - run: echo "Hello world from Alpine"
      - run: cat /etc/alpine-release
      - run: echo "INPUT_IMAGE=$INPUT_IMAGE"
      - run: echo "INPUT_CONDITION=$INPUT_CONDITION"
```

The runner will currently output un-evaluated expressions:
```
INPUT_IMAGE=${{ inputs.image }}
INPUT_CONDITION=${{ inputs.condition }}
```

Internally, the workflow is using `INPUT_...` environment variables to transfer data into local reusable workflows, and the order of evaluation in `getEvaluatorInputs` was preferring to use the un-evaluated value, over the evaluated value.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1080): <!--number 1080 --><!--line 0 --><!--description Zml4OiBhbGxvdyBtYXBwaW5nIGludG8gZW52IHZhcmlhYmxlIElOUFVUX04gZnJvbSAke3sgaW5wdXRzLm4gfX0=-->fix: allow mapping into env variable INPUT_N from ${{ inputs.n }}<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1080
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-10 21:55:08 +00:00
..
artifactcache fix: allow GC & cache operations to operate concurrently (#1040) 2025-09-30 19:12:45 +00:00
cacheproxy chore: add additional logging to cacheproxy (#1065) 2025-10-07 08:12:16 +00:00
common chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
container feat: allow --memory in workflow container options (#1079) 2025-10-10 14:33:07 +00:00
exprparser feat: the forgejo context is equivalent to the github context (#999) 2025-09-15 09:14:11 +00:00
filecollector chore: modernize code (#857) 2025-08-15 04:54:13 +00:00
jobparser feat: improve readability of error messages from ParseRawOn (#1063) 2025-10-07 14:41:55 +00:00
lookpath chore: use the same .golangci.yml as the runner & gofumpt over gofmt (#206) 2025-07-28 12:26:41 +00:00
model chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
runner fix: allow mapping into env variable INPUT_N from ${{ inputs.n }} (#1080) 2025-10-10 21:55:08 +00:00
schema chore: test: exercise contexts in matrix when validating workflows (#1033) 2025-09-28 07:15:51 +00:00
workflowpattern chore: modernize code (#857) 2025-08-15 04:54:13 +00:00