ref(dev): Improve labeling of checkout step in GHA#5156
Merged
lobsterkatie merged 2 commits into7.xfrom May 24, 2022
Merged
Conversation
Contributor
size-limit report 📦
|
Lms24
approved these changes
May 24, 2022
AbhiPrasad
pushed a commit
that referenced
this pull request
May 30, 2022
Currently, when looking at runs of our `Build & Test` GHA workflow, it's often hard to tell exactly what commit is being used. When the workflow is triggered by a push to a PR, the PR title ends up as the label, which can be pretty uninformative. Runs triggered manually are no better, as they're merely labeled "Build & Test." Runs triggered by pushes _are_ better, at least from the Actions tab, because they're labeled for their commit, but once you open one up, it's not obvious from the logs which commit is being used, since "Check out current commit (<some SHA here>)" doesn't actually list the branch's `HEAD` commit but rather a made-up merge commit between `HEAD` and the base branch, making it useless for identifying `HEAD`. (See the PR description for screenshots of these different cases.) This fixes that problem, by adding a preliminary GHA job to gather and store the SHA of the actual branch head (along with its commit message). Subsequent jobs can then use that information to label their checkout step, making it much easier to tell where in the commit history the job falls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, when looking at runs of our
Build & TestGHA workflow, it's often hard to tell exactly what commit is being used. When the workflow is triggered by a push to a PR, the PR title ends up as the label, which can be pretty uninformative:Runs triggered manually are no better:
Runs triggered by pushes are better...
...at least from the outside, but once you're in one, it's not obvious from the logs which commit is being used:
(That SHA listed in the checkout step isn't even that helpful, because by default it's not the branch's
HEADcommit but rather a made-up merge commit betweenHEADand the base branch, making it useless for identifyingHEAD.)This fixes that problem, by adding a preliminary GHA job to gather and store the SHA of the actual branch head (along with its commit message). Subsequent jobs can then use that information to label their checkout step, making it much easier to tell where in the commit history the job falls: