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

fix: Fix dispatch event checkout #3407

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

fix: Fix dispatch event checkout #3407

wants to merge 7 commits into from

Conversation

sfc-gh-jmichalak
Copy link
Collaborator

@sfc-gh-jmichalak sfc-gh-jmichalak commented Feb 21, 2025

  • Fix checking out code in the repository dispatch event by specifying the repository and ref.
  • Print more debug info during hash verification.

Test Plan

Dispatch events utilize pipelines from the default branch, and custom dispatch events cannot be run before merge—see https://github.com/orgs/community/discussions/24657?sort=top. This is why this change was not tested in this repository, as the changes already need to be present on the default branch.

Instead, I tested it on my personal repository with a simplified setup, but preserving the logic. I confirmed that for dispatch events, the checkout was done to the default origin branch, and after these changes, the checkout is done on the correct sha in the forked branch.

References

#3400 (comment)

TODO

Check the dispatch after it's merged to the default branch.

Copy link

Integration tests success for 814e4e22ae230c8ccd708b2bf4ef9c331c30818b

Copy link

Integration tests cancelled for e5c5dfb40a46140cee089f89f03d71c3cfddb723

@sfc-gh-jmichalak sfc-gh-jmichalak marked this pull request as ready for review February 21, 2025 16:04
Copy link

Integration tests failure for 3b5ce99f48c9045899547b899e7c00b448e1ccec

if: (github.event_name == 'repository_dispatch')
uses: actions/checkout@v3
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to specify the repository name? Isn't it the default in this action?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine (?) Default: ${{ github.repository }} not sure what is the difference between the two. Maybe there's some kind of additional data that can be passed to the repository field that would make it able to checkout on the fork (?)

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