actions / actions/toolkit

Accessing variable in format() method gives an error.

Open
#1,902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Accessing variable in format() method gives an error.

To Reproduce
Steps to reproduce the behavior:

  1. Write a similar step in GitHub Action job:

    • name: Output variable
      run: |
      my_variable ='blabla'
      echo ${{ format('startOfString{0}', $my_variable ) }}
      shell: bash
  2. Run corresponding GitHub Action

  3. See error :
    "The workflow is not valid. .github/workflows/my_workflow_file.yml (Line: a, Col: b): Unexpected symbol: '$my_variable'. Located at position... "

Expected behavior
String with substituted value should be printed .

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Windows]
  • Browser [Microsoft Edge]
  • Version [131]

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 with the reproduction in .github/workflows/my_workflow_file.yml and review the GitHub Actions expression and shell-variable syntax used in the run block. Determine whether the reported error is handled by this toolkit or by workflow expression evaluation; done means confirming the responsible component and documenting or reproducing the expected substituted output.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.