Add optional environment variables to get workflow from another repo #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the option to set 'custom' environment variables for the GitHub repository and owner.
Motivation
We have a lot of repositories in our organisation, so to avoid having to add the exporter workflow to each of them and maintain them, I was looking at ways to run a single workflow and have all the other repos 'report' to it (via a
repository_dispatch
API call). In order for this to work though, we need to override theGITHUB_REPOSITORY
environment variable, which isn't possible currently in a GitHub Actions workflow. So we needed to be able to set a different environment variable which could be ignored if the workflow was just running in the same repository. I've also added a new environment variable for GitHub owner - although we don't need this ourselves it might be useful for someone.Example