Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Set CHECKOUT_URL and CHECKOUT_REF #292

Open
aminya opened this issue Jun 29, 2020 · 4 comments
Open

[Feature] Set CHECKOUT_URL and CHECKOUT_REF #292

aminya opened this issue Jun 29, 2020 · 4 comments

Comments

@aminya
Copy link

aminya commented Jun 29, 2020

It would be nice if the action sets some environment variables about the repository and branch that is checking out. In particular, CHECKOUT_URL and CHECKOUT_REF are the two ones that I am interested in. I need to know these for some other operations.

@ericsciple
Copy link
Contributor

Does GITHUB_REF and GITHUB_REPOSITORY help?

Here is a list, but I often run printenv|sort since sometimes the docs lag behind.

@aminya
Copy link
Author

aminya commented Jul 13, 2020

Those specify the repository and branch that trigger the action. But a user can decide to check out a completely different repository or branch based on the docs:
https://github.com/actions/checkout#usage

That is why I want to know the branch they have checked out.

@ericsciple
Copy link
Contributor

Have you considered using the git command? For example, something like this to get the current branch: git rev-parse --symbolic-full-name HEAD

@andrewalc
Copy link

having some sort of output or env for this would be incredibly convenient and save an extra step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants