[GH-ISSUE #2370] GitHub Event Context missing: github.event.repository.name #1089

Closed
opened 2026-03-01 21:48:48 +03:00 by kerem · 3 comments
Owner

Originally created by @katherine-circularise on GitHub (Jun 19, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2370

Bug report info

not applicable

Command used with act

act <any workflow>

Describe issue

GitHub repository name is available via GITHUB_REPOSITORY env var, however I was using the event context (github.event.repository.name) as that already handles split by / for you. I've noticed that this is missing, which was leading to an empty string evaluation in my workflow.

If I have time, and manage to walk my way around the codebase, I'll send a PR adding this to the runner context. Creating the issue to keep track of htis.

No response

Workflow content

name: myWorkflow
on:
  push:
jobs:
  myJob:
    steps:
      - env:
          REPO_NAME: ${{ github.event.repository.name }}
        run: echo "Name: m${REPO_NAME}m"

Relevant log output

...
Name: mm
...

Additional information

No response

Originally created by @katherine-circularise on GitHub (Jun 19, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2370 ### Bug report info ```plain text not applicable ``` ### Command used with act ```sh act <any workflow> ``` ### Describe issue GitHub repository name is available via GITHUB_REPOSITORY env var, however I was using the event context (github.event.repository.name) as that already handles split by / for you. I've noticed that this is missing, which was leading to an empty string evaluation in my workflow. If I have time, and manage to walk my way around the codebase, I'll send a PR adding this to the runner context. Creating the issue to keep track of htis. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: myWorkflow on: push: jobs: myJob: steps: - env: REPO_NAME: ${{ github.event.repository.name }} run: echo "Name: m${REPO_NAME}m" ``` ### Relevant log output ```sh ... Name: mm ... ``` ### Additional information _No response_
kerem 2026-03-01 21:48:48 +03:00
Author
Owner

@kittydoor commented on GitHub (Jun 19, 2024):

Whoops, that's the work account. Looping my personal account into the issue.

<!-- gh-comment-id:2177996298 --> @kittydoor commented on GitHub (Jun 19, 2024): Whoops, that's the work account. Looping my personal account into the issue.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 17, 2024):

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

<!-- gh-comment-id:2547209188 --> @github-actions[bot] commented on GitHub (Dec 17, 2024): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@nbraun1 commented on GitHub (Apr 25, 2025):

Hi @kittydoor, I had the same problem and found a solution (for me). You have to pass an event file to provide event payload as described here. The payload file is in json format and the properties are documented here. You can pass the event payload with the --eventpath CLI option to act, e.g.:

act push --workflows ".github/workflows/myWorkflow.yml" --eventpath "/home/user/git/myRepo/myProject/payload.json"

Event payload json example:

{
    "repository": {
        "name": "myProject"
    }
}

This ensures that github.event.repository.name is resolved correctly.

Best regards

<!-- gh-comment-id:2830048723 --> @nbraun1 commented on GitHub (Apr 25, 2025): Hi @kittydoor, I had the same problem and found a solution (for me). You have to pass an event file to provide event payload as described [here](https://nektosact.com/usage/index.html#using-event-file-to-provide-complete-event-payload). The payload file is in json format and the properties are documented [here](https://docs.github.com/en/webhooks/webhook-events-and-payloads). You can pass the event payload with the `--eventpath` CLI option to `act`, e.g.: ```bash act push --workflows ".github/workflows/myWorkflow.yml" --eventpath "/home/user/git/myRepo/myProject/payload.json" ``` Event payload json example: ```json { "repository": { "name": "myProject" } } ``` This ensures that `github.event.repository.name` is resolved correctly. Best regards
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#1089
No description provided.