Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite Actions fail to overwrite env if it is already set #1899

Closed
thboop opened this issue May 17, 2022 · 1 comment · Fixed by #1794
Closed

Composite Actions fail to overwrite env if it is already set #1899

thboop opened this issue May 17, 2022 · 1 comment · Fixed by #1794
Assignees
Labels
bug Something isn't working Runner Bug Bug fix scope to the runner

Comments

@thboop
Copy link
Collaborator

thboop commented May 17, 2022

Describe the bug
Setting an env that is already set in a composite action causes the value to not be set as expected.
To Reproduce
Setup a composite action

  using: "composite"
  steps:
    - name: set env
      shell: bash
      run: |
        VAR1=$RANDOM
        echo "MY_VAR1=$(echo $VAR1)" >> $GITHUB_ENV
        echo $VAR1
        echo 'create finished'
  
    # Show ref information
    - name: Show ref information
      run: |
          echo 'random1'
          echo $MY_VAR1
          echo 'env-random1'
          echo "${{ env.MY_VAR1 }}"
          echo 'read finished'
      shell: bash

Call it twice locally using uses: ./{path}
Notice the second time the value it reads is incorrect.
Expected behavior
A clear and concise description of what you expected to happen.

Runner Version and Platform

2.291.1 linux

@thboop thboop added bug Something isn't working Runner Bug Bug fix scope to the runner labels May 17, 2022
@ChristopherHX
Copy link
Contributor

I believe this is a duplicate of #789, which could be fixed by #1794.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Runner Bug Bug fix scope to the runner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants