mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #1424] Allow GITHUB_REPOSITORY to be overridden #746
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#746
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emmjohnson on GitHub (Nov 4, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1424
Act version
0.2.33
Feature description
When developing a github action, it would be cool to be able to write end to end tests with act. We would need the ability to override GITHUB_REPOSITORY (and SHA) to emulate a user using our action in their repo.
Currently GITHUB_REPOSITORY is automatically set to the action we are developing the action in.
@KnisterPeter commented on GitHub (Nov 4, 2022):
You can do with an event json file
@emmjohnson commented on GitHub (Nov 4, 2022):
I'm having a hard time finding any simple examples of this, do you know of any?
@KnisterPeter commented on GitHub (Nov 4, 2022):
The payloads (link on each event) does contain examples per event:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
@KnisterPeter commented on GitHub (Nov 4, 2022):
After some more thoughts I'm not sure if all props could be set by the event file.
I'll reopen the request. Maybe someone is willing to implement it
@emmjohnson commented on GitHub (Nov 4, 2022):
Okay, I tried a few things with the events and inputs and was unable to achieve setting the GITHUB_REPOSITORY
@ChristopherHX commented on GitHub (Nov 4, 2022):
You can create an empty git repository with a different origin, everything else needs code changes of act.
I added in a similar tool like this one the following cli flags
--repository,--sha,--refto override the guessed valuesTo set a random github.sha, just commit a file.
@emmjohnson commented on GitHub (Nov 8, 2022):
What tool did you add @ChristopherHX ?
@ChristopherHX commented on GitHub (Nov 8, 2022):
As I have mentioned you can change GITHUB_REPOSITORY via a workaround in act.
You find a comment about a tool based on actions/runner in https://github.com/cli/cli/issues/3585
@shubhbapna commented on GitHub (Dec 19, 2022):
Is it possible to have an option to override any of the
GITHUB_env variables? We create local repositories to run the e2e tests for our custom actions. So, it would be helpful to control those variables in that environment.@shubhbapna commented on GitHub (Jan 24, 2023):
@KnisterPeter @ChristopherHX are y'all open to adding this feature? I am willing to create a PR for it
@KnisterPeter commented on GitHub (Jan 24, 2023):
Yes, from my point of view it's fine.
@ChristopherHX commented on GitHub (Jan 24, 2023):
Yes, such a feature would get my approval.