act icon indicating copy to clipboard operation
act copied to clipboard

GITHUB_REF in event spec not overriding actual branch name

Open fauxbytes opened this issue 3 years ago • 0 comments

Discussed in https://github.com/nektos/act/discussions/1453

Originally posted by fauxbytes November 22, 2022

$ git br --show-current
bb
$ cat .github/workflows/bar.yml
name: bar
on: push
jobs:
  bar:
    runs-on: ubuntu-latest
    steps:
      - name: my-step
        run: |
          env | grep GITHUB_REF
$ cat push.json
{
  "push": {
    "ref": "refs/heads/development"
  }
}
$ act push -e push.json -j bar
[bar/bar] 🚀  Start image=catthehacker/ubuntu:act-latest
[bar/bar]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[bar/bar]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[bar/bar]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[bar/bar] ⭐ Run Main my-step
[bar/bar]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| GITHUB_REF_TYPE=branch
| GITHUB_REF=refs/heads/bb
| GITHUB_REF_NAME=bb
[bar/bar]   ✅  Success - Main my-step
[bar/bar] 🏁  Job succeeded

Shouldn't GITHUB_REF be set as-per the event file? How do I get it to work as expected? Thanks!

fauxbytes avatar Nov 26 '22 20:11 fauxbytes