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

Add GITHUB_REF detection #27

Merged
merged 1 commit into from
Dec 29, 2020
Merged

Conversation

AustinShalit
Copy link
Member

@AustinShalit AustinShalit commented Dec 28, 2020

This is a workaround for actions/checkout#290. As described in that issue, the goal of the checkout action is to always run on the provided build hash even if additional tags have been pushed. This means if a user pushed 2 tags at the same time, 2 build artifacts will result. One workaround proposed is to force pull tags. This workaround breaks the promise of GitHub builds – 2 tag pushes now can result in 2 independent builds but 1 build artifact total.

This PR adds detection for the GITHUB_REF environment variable. If we detect the variable and are in release mode, we will trust that the variable is correct. Otherwise, we fallback onto the already proven git describe method.

You can see it in action here:

master: https://github.com/AustinShalit/OutlineViewer/runs/1616714453?check_suite_focus=true
"beta 5": https://github.com/AustinShalit/OutlineViewer/runs/1616715084?check_suite_focus=true
"beta 6": https://github.com/AustinShalit/OutlineViewer/runs/1616715071?check_suite_focus=true

@sciencewhiz
Copy link
Contributor

GITHUB_REF will have the branch name, if the commit isn't tagged. Is that handled elsewhere, or does there need to be a check for that?

@AustinShalit
Copy link
Member Author

@AustinShalit AustinShalit merged commit 8a02087 into wpilibsuite:master Dec 29, 2020
@AustinShalit AustinShalit deleted the githubref branch December 29, 2020 01:48
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

Successfully merging this pull request may close these issues.

3 participants