checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Unable to use env var for ref

Open bitzer-sbc opened this issue 1 year ago • 0 comments

I'm trying to setup a GitHub action with tag in environment variable:

env:
  buildtag: 'v1.1.0'
jobs:
    build-and-deploy:
            runs-on: ubuntu-latest
            steps:
              - name: Show environment variable
                run: echo "Tag $buildtag"
              - name: Checkout code
                uses: actions/checkout@v4
                with: 
                  ref: $buildtag

but output shows the var unresolved:

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/$buildtag*:refs/remotes/origin/$buildtag* +refs/tags/$buildtag*:refs/tags/$buildtag*
The process '/usr/bin/git' failed with exit code 1
Waiting 19 seconds before trying again
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/$buildtag*:refs/remotes/origin/$buildtag* +refs/tags/$buildtag*:refs/tags/$buildtag*
Error: The process '/usr/bin/git' failed with exit code 1

bitzer-sbc avatar Oct 23 '24 08:10 bitzer-sbc