Skip to content

Commit

Permalink
Fix environment variable syntax (#1397)
Browse files Browse the repository at this point in the history
On master this works:

      - name: Create GH Release
        uses: softprops/action-gh-release@v2
        with:
          generate_release_notes: true
          files: |
            dist/*.tar.gz
          prerelease: ${{ env.IS_PRERELEASE }}
        env:
          GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}

On release-3.x.x this fails:

```
  publish:
    name: publish
    needs:
      - prerequisites
      - test-nodejs
      - test-python
      - test-dotnet
      - test-go
    uses: ./.github/workflows/publish.yml
    secrets: inherit
    with:
      version: ${{ needs.prerequisites.outputs.version }}
      isPrerelease: ${{ env.IS_PRERELEASE }}
```

With:

```
 Invalid workflow file: .github/workflows/release.yml#L194
 The workflow is not valid. .github/workflows/release.yml (ine: 194, Col: 21):
 Unrecognized named-value: 'env'.
 Located at position 1 within expression: env.IS_PRERELEASE
```

Possibly related actions/runner#1189

Working around by in-lining the ENV var.
  • Loading branch information
t0yv0 authored Sep 26, 2024
1 parent fa3ddf5 commit 4a44753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ env:
DOTNETVERSION: "6.x"
PYTHONVERSION: "3.8"
JAVAVERSION: "11"
IS_PRERELEASE: ${{ contains(github.ref_name,'-') }}
jobs:
lint:
name: Lint and unit test
Expand Down Expand Up @@ -191,7 +190,7 @@ jobs:
secrets: inherit
with:
version: ${{ needs.prerequisites.outputs.version }}
isPrerelease: ${{ env.IS_PRERELEASE }}
isPrerelease: ${{ contains(github.ref_name,'-') || github.event_name == 'workflow_dispatch' }}

test-nodejs:
name: Run NodeJS Tests
Expand Down Expand Up @@ -600,3 +599,4 @@ name: release
push:
tags:
- v*.*.*
workflow_dispatch: {}

0 comments on commit 4a44753

Please sign in to comment.