actions / actions/toolkit

getInput does not replace envs

Open
#623 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement external
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I use a github action (https://github.com/xresloader/upload-to-github-release) to upload some files which the name contains some environment variable, but it seems getInput does not process envs replacement. getInput("file") got ${APP_NAME}-linux-1.0.0+1.zip in the following example.

      - uses: xresloader/upload-to-github-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          file: ${APP_NAME}-linux-${{ steps.branch_name.outputs.SOURCE_NAME }}.zip
          tags: true
          draft: false
Run xresloader/upload-to-github-release@v1
  with:
    file: ${APP_NAME}-linux-1.0.0+1.zip
    tags: true
    draft: false
    overwrite: false
    prerelease: false
    verbose: false
    update_latest_release: false
  env:
    APP_NAME: ynu_network_reset
    JAVA_HOME_8.0.272_x64: /opt/hostedtoolcache/jdk/8.0.272/x64
    JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.272/x64
    JAVA_HOME_8_0_272_X64: /opt/hostedtoolcache/jdk/8.0.272/x64
    FLUTTER_HOME: /opt/hostedtoolcache/flutter/1.24.0-6.0.pre-dev/x64
    GITHUB_TOKEN: ***
Found tag to push: 1.0.0+1.
Error: Can not find any file by ${APP_NAME}-linux-1.0.0+1.zip

https://github.com/xresloader/upload-to-github-release/blob/fdd72e02aaa9581a25515ebc2d8ec0492efb635a/src/index.ts#L15

Expected behavior
getInput can process envs or provide some options for envs replacement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/index.ts#L15 and inspect how getInput handles the file value passed by the action. Reproduce the example with APP_NAME set, then verify that the documented environment-variable behavior no longer leaves ${APP_NAME} literal in the resolved input.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.