[GH-ISSUE #1469] GITHUB_REF in event spec not overriding actual branch name #754

Closed
opened 2026-03-01 21:46:06 +03:00 by kerem · 1 comment
Owner

Originally created by @fauxbytes on GitHub (Nov 26, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1469

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!

Originally created by @fauxbytes on GitHub (Nov 26, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1469 ### Discussed in https://github.com/nektos/act/discussions/1453 <div type='discussions-op-text'> <sup>Originally posted by **fauxbytes** November 22, 2022</sup> ``` $ 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!</div>
kerem 2026-03-01 21:46:06 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Dec 27, 2022):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1365515085 --> @github-actions[bot] commented on GitHub (Dec 27, 2022): Issue is stale and will be closed in 14 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#754
No description provided.