fix: Checkout master before hogql-diff and use new GH syntax #18461
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.
Problem
I'm seeing a
fatal: bad revision 'master'
line when checking if hogql-parser has changed compared to master. This is causing PRs to run for 5-7 minutes setting-up hogql/antlr, even if nothing changed.The solution should be to fetch origin and diff with origin/master. I'm doing this manually which is probably not the cleanest, but given the amount of time lost to building antlr, this is nothing.
Moreover, we are using the set-output command which was deprecated last year, but then un-deprecated this year.
It's not clear to me whether
::set-otuput
is still supported or not, but anyways, we should use the new recommended syntax.Changes
echo "::set-output name=changed::$changed"
forecho "changed=$changed" >> $GITHUB_OUTPUT
origin/master
for hogl changes.👉 Stay up-to-date with PostHog coding conventions for a smoother review.
How did you test this code?
I rebased my PR on top of this, notice no time spent building antlr: https://github.com/PostHog/posthog/actions/runs/6789574178/job/18457089273?pr=18463. Compare that run against another earlier PR I merged which did built antlr: https://github.com/PostHog/posthog/actions/runs/6782379713/job/18435144400. None of them changed hogql_parser in anyway.
Logs of the old run: