Skip to content

ci: retrigger crates check on PR updates#5357

Merged
clason merged 1 commit intomasterfrom
ohnoesitbroke
Feb 22, 2026
Merged

ci: retrigger crates check on PR updates#5357
clason merged 1 commit intomasterfrom
ohnoesitbroke

Conversation

@clason
Copy link
Contributor

@clason clason commented Feb 21, 2026

Just testing the new CI workflow, which should fail on this PR. But doesn't 😞

@clason clason added the ci:check release Conduct a dry run of the rust release workflow. label Feb 21, 2026
@clason clason added ci:check release Conduct a dry run of the rust release workflow. and removed ci:check release Conduct a dry run of the rust release workflow. labels Feb 21, 2026
@clason clason changed the title OHNOOHNOOHNO ci: test new workflow [DO NOT MERGE] Feb 21, 2026
@WillLillis
Copy link
Member

This exact test works locally when running the workflow manually via node. I suspect we may need to pass in the repo's API token so the workflow can go through its "which files changed since the last release" step, but more testing is necessary to be certain.

@clason clason added ci:check release Conduct a dry run of the rust release workflow. and removed ci:check release Conduct a dry run of the rust release workflow. labels Feb 21, 2026
@clason
Copy link
Contributor Author

clason commented Feb 21, 2026

Hmm, that's not it, either

@clason clason force-pushed the ohnoesitbroke branch 2 times, most recently from 9c41596 to 85b4712 Compare February 21, 2026 15:32
@clason clason changed the title ci: test new workflow [DO NOT MERGE] ci: retrigger crates check on PR updates Feb 21, 2026
@clason
Copy link
Contributor Author

clason commented Feb 21, 2026

If I understand this correctly, what's happening here is that the action always runs from the master branch, so it won't see any changes made in the PR itself.

This makes it impossible to test here (although you should be able to do this on a fork with a merged breaking commit). But it should still fulfill its purpose of a sanity check for state of the branch itself when preparing a release.

@clason clason added ci:backport release-0.26 Backport label and removed ci:check release Conduct a dry run of the rust release workflow. labels Feb 21, 2026
@WillLillis
Copy link
Member

I tested this workflow with the addition of

with:
  ref: ${{ github.event.pull_request.head.sha }}

to the "Checkout repository" step on my fork and it behaves correctly.

Manually dispatched workflow failing: https://github.com/WillLillis/tree-sitter/actions/runs/22272379656

Failing in a PR after the label was added: https://github.com/WillLillis/tree-sitter/actions/runs/22272416983/job/64429177745?pr=10

Passing in the same PR after the language crate version was bumped: https://github.com/WillLillis/tree-sitter/actions/runs/22272439586/job/64429243132?pr=10

And here's the PR for reference: WillLillis#10.

There is a chance the workflow may fail prematurely on PRs across forks. This shouldn't happen because of how we've modified our checkout step, but in case it does, the manual dispatch will not run into the same issues (otherwise the action itself would be unsound as we're using it now for real releases).

@clason clason added the ci:check release Conduct a dry run of the rust release workflow. label Feb 22, 2026
@clason
Copy link
Contributor Author

clason commented Feb 22, 2026

Sorry, didn't notice before: the trigger needs to be pull_request, not pull_request_target, otherwise it won't see force pushes and other updates to retrigger the check.

Now the check also sees any changes in the pull request, so we can add the language crate bump to the release PR if needed.

@clason clason requested a review from WillLillis February 22, 2026 14:22
@clason clason enabled auto-merge (rebase) February 22, 2026 14:22
@clason clason merged commit e62bf4e into master Feb 22, 2026
26 of 34 checks passed
@clason clason deleted the ohnoesitbroke branch February 22, 2026 14:29
@tree-sitter-ci-bot
Copy link

Successfully created backport PR for release-0.26:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:backport release-0.26 Backport label ci:check release Conduct a dry run of the rust release workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants