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

Using ref with an env value doesn't work on windows anymore #1414

Open
jwillemsen opened this issue Jul 19, 2023 · 2 comments
Open

Using ref with an env value doesn't work on windows anymore #1414

jwillemsen opened this issue Jul 19, 2023 · 2 comments

Comments

@jwillemsen
Copy link

I have a workflow where I determine the branch to clone dependent repositories based on the github event name. The branch is set in $GITHUB_ENV but it seems this doesn't work on Windows as it did in the past.

See https://github.com/jwillemsen/checkoutbug/blob/master/.github/workflows/test.yml and attached for the test workflow. On Linux the dependent taox11 repo is cloned using the master branch as set by the step. But on Windows it just uses BAR, the value is changed in the environment, but it seems that is not used

@jwillemsen
Copy link
Author

jwillemsen commented Jul 19, 2023

Test workflow, and windows and linux output

test.yml.txt
windows.zip
linux.zip

@jwillemsen
Copy link
Author

I use an environment variable defined as

env:
  X11_BRANCH: BAR

And use some steps to determine which branch to build, the branch si put into $GITHUB_ENV

    - if: contains(fromJson('["pull_request", "pull_request_target"]'), github.event_name)
      run: |
        echo "X11_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
    - if: contains(fromJson('["pull_request", "pull_request_target"]'), github.event_name) == false
      run: |
        echo "X11_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV

Where the variable is used to checkout a dependent repo as

    - name: checkout taox11
      uses: actions/checkout@v3
      with:
        repository: RemedyIT/taox11
        path: ${{ env.TAOX11_ROOT }}
        ref: ${{ env.X11_BRANCH }}

On Linux it checked out master as it should, on Windows it just uses BAR, but the log shows that the variable is set to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant