Skip to content

Add support for GITHUB_REPOSITORY#3557

Closed
austindrenski wants to merge 1 commit intocli:trunkfrom
austindrenski:gh-repo-fallback-to-github-repository-for-github-actions
Closed

Add support for GITHUB_REPOSITORY#3557
austindrenski wants to merge 1 commit intocli:trunkfrom
austindrenski:gh-repo-fallback-to-github-repository-for-github-actions

Conversation

@austindrenski
Copy link

GitHub Actions sets a default GITHUB_REPOSITORY environment variable with the owner and repository name (e.g. octocat/Hello-World).

This PR adds support to read the GITHUB_REPOSITORY environment variable as a fallback when the GH_REPO environment variable is not set. If both environment variables are set, GH_REPO takes precedence over GITHUB_REPOSITORY, mirroring the behavior of GH_TOKEN and GITHUB_TOKEN.

Fixes: #3556

(This is my first time working in Go, so I've tried to match existing style, but have surely missed something, so very open to any/all nits.)

GitHub Actions sets a default [GITHUB_REPOSITORY][docs] environment
variable with the owner and repository name (e.g. octocat/Hello-World).

This commit adds support to read the GITHUB_REPOSITORY environment
variable as a fallback when the GH_REPO environment variable is not set.

If both environment variables are set, GH_REPO takes precedence over
GITHUB_REPOSITORY, mirroring the behavior of GH_TOKEN and GITHUB_TOKEN.

[docs]: https://docs.github.com/actions/reference/environment-variables
Copy link

@Stolenwings13 Stolenwings13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@mislav
Copy link
Contributor

mislav commented May 3, 2021

@austindrenski Thank you for the proposal and for the contribution! The code looks great, so congrats on your first Go contribution 🎉 But first, let's talk about the feature itself. #3556 (comment)

@mislav mislav added the blocked label May 3, 2021
@vilmibm vilmibm self-assigned this Jun 2, 2021
@mislav mislav added the enhancement a request to improve CLI label Aug 4, 2021
@mislav mislav added the external pull request originating outside of the CLI core team label Dec 20, 2021
@vilmibm vilmibm assigned samcoe and unassigned vilmibm Jan 10, 2022
Copy link

@Pyone5 Pyone5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rob@roberts-mbp gh_private2internal % ./main.sh explosion

Showing 99 of 99 repositories in @explosion that match your search

REPONAME Repo powering the API for the Arizona consultancy project private 0m
REPONAME Ontology-based entity detection and linking for the biomedical domain. private 37m
REPONAME_FOR_INTERNAL_REPO private 50m
REPONAME Corpora and other data files for internal spaCy training. private 2h

@Pyone5

This comment has been minimized.

@samcoe
Copy link
Contributor

samcoe commented Jan 12, 2022

@austindrenski Looks like there was resolution on direction that we want to take #3556 (comment). Are you willing to rework this PR to move that direction? Or is it okay to close this PR and give another community member an opportunity to contribute a PR to solve the issue?

@vilmibm vilmibm added the more-info-needed More info needed from user/contributor label Jan 25, 2022
@samcoe samcoe removed the blocked label Jan 27, 2022
@samcoe
Copy link
Contributor

samcoe commented Feb 2, 2022

Going to close this for now due to lack of response.

@samcoe samcoe closed this Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement a request to improve CLI external pull request originating outside of the CLI core team more-info-needed More info needed from user/contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support GITHUB_REPOSITORY

6 participants