Open AndesKrrrrrrrrrrr opened 1 month ago
..........
GITHUB_ACTION_PATH=
GITHUB_ACTION_REPOSITORY GITHUB_ACTION_REF=
Those are empty as run is not an action, please check this against actions/runner
GITHUB_BASE_REF=
GITHUB_HEAD_REF=
act pull_request exclusive if -e
provides specfic pr webhook keys
please check against actions/runner when your job runs via push
Do you have some suggestion to get the values? I believe we have documented how the event.json must look like, but that could be invalid didn't verify
GITHUB_REF_TYPE=
What is expected here for refs/pull ? I remember that was undefined while the code has been written and empty was correct
GITHUB_ACTION_PATH= GITHUB_ACTION_REPOSITORY GITHUB_ACTION_REF=
Those are empty as run is not an action, please check this against actions/runner
Yeah, that makes sense. For now, I don't care about these anyways.
GITHUB_BASE_REF= GITHUB_HEAD_REF=
act pull_request exclusive if
-e
provides specfic pr webhook keys please check against actions/runner when your job runs via push
What do you mean by this (act pull_request exclusive
)?
Do you have some suggestion to get the values? I believe we have documented how the event.json must look like, but that could be invalid didn't verify
We can gather these independent of Github, since we know the base branch, and the current branch. We can set GITHUB_BASE_REF
to the argument of --defaultbranch
or create a new flag --basebranch
(defaulting to --basebranch
). GITHUB_HEAD_REF
can be gathered from git
as either the current branch name, or the current commit hash.
GITHUB_REF_TYPE=
What is expected here for refs/pull ? I remember that was undefined while the code has been written and empty was correct
From the docs, though, I've never used it myself or seen it used :shrug:
The type of ref that triggered the workflow run. Valid values are
branch
ortag
.
From the docs, though, I've never used it myself or seen it used 🤷
The type of ref that triggered the workflow run. Valid values are
branch
ortag
Yes, that is for refs/tag/ and refs/heads/, but we are writing about refs/pull/. For branch and tag it is implemented. Stll this has been empty on GH at one point of time for PR's (no push, no anything else), I don't verify such information periodically.
What do you mean by this (
act pull_request exclusive
)?
The trigger event name is checked: Tbh, this looks like to miss pull_request_review and so on
act push never set's the value from event.json, but I think you don't provide such a file.
To set the value currently just do
act --env GITHUB_HEAD_REF=pr --env GITHUB_BASE_REF=main
that has no event name filter. But then github.event doesn't mirror the value in the wenhook structure
we know the base branch
I don't know it, I would need to guess it. A sha might be an unexpected value here
Not every PR goes to default branch, only most.
As a default fallback it's ok, you can make a pr, but please only for events contain pull_request in their name
GITHUB_HEAD_REF
can be gathered fromgit
as either the current branch name, or the current commit hash.
As a default fallback it's ok, you can make a pr, but please only for events contain pull_request in their name
Bug report info
Command used with act
Describe issue
Some
GITHUB_*_REF
variables are empty, even though Act claims on its front page to provide these variables.These are empty:
Link to GitHub repository
https://github.com/AndesKrrrrrrrrrrr/act-MWE/tree/main
Workflow content
Relevant log output
Additional information
No response