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

event file overrides github.ref but not github.ref_name #2627

Open
Dr-Electron opened this issue Jan 21, 2025 · 0 comments
Open

event file overrides github.ref but not github.ref_name #2627

Dr-Electron opened this issue Jan 21, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@Dr-Electron
Copy link

Bug report info

act version:            0.2.71
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/Users/dr-electron/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.23.4
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.71
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 darwin
		GOAMD64:              v1
Docker Engine:
	Engine version:        27.4.1
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    OrbStack
	OS type:               linux
	OS version:            
	OS arch:               x86_64
	OS kernel:             6.12.10-orbstack-00297-gf8f6e015b993
	OS CPU:                16
	OS memory:             16049 MB
	Security options:
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

act -W ./.github/workflows/upload-docs-to-aws.yml -P ubuntu-latest=catthehacker/ubuntu:full-20.04 -e event.json

Describe issue

I have an event.json file with the following content:

{
    "ref": "develop",
    "ref_name": "develop"
}

If I look at the GitHub context, github.ref is set to develop, but github.ref_name is not. Seems inconsistent to me.

Link to GitHub repository

No response

Workflow content

on:
  push:
    branches:
      - develop

jobs:
  build-and-upload-docs:
    runs-on: ubuntu-latest

    steps:
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"

Relevant log output

| {
|   "event": {
|     "ref": "develop",
|     "ref_name": "develop"
|   },
|   "event_path": "/var/run/act/workflow/event.json",
|   "workflow": "Upload Docs to S3",
|   "run_attempt": "1",
|   "run_id": "1",
|   "run_number": "1",
|   "actor": "nektos/act",
|   "repository": "",
|   "event_name": "push",
|   "sha": "ca9b545cb54f9f2b9905cab56102936d81f79fe6",
|   "ref": "develop",
|   "ref_name": "",
|   "ref_type": "",
|   "head_ref": "",
|   "base_ref": "",
|   "token": "",
|   "workspace": "",
|   "action": "0",
|   "action_path": "",
|   "action_ref": "",
|   "action_repository": "",
|   "job": "build-and-upload-docs",
|   "job_name": "",
|   "repository_owner": "",
|   "retention_days": "0",
|   "runner_perflog": "/dev/null",
|   "runner_tracking_id": "",
|   "server_url": "https://github.com",
|   "api_url": "https://api.github.com",
|   "graphql_url": "https://api.github.com/graphql"
| }

Additional information

No response

@Dr-Electron Dr-Electron added the kind/bug Something isn't working label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant