dagster-io / dagster-cloud-action

Apache License 2.0
13 stars 20 forks source link

Use github.head_ref in ci init if the event is a PR #170

Closed vicyap closed 6 months ago

vicyap commented 6 months ago

This PR changes the commit hash used by ci-init to use github.head_ref instead of github.sha.

github.sha on a PR event returns the merged commit sha of the default branch merged with the head commit of the PR's branch. This merge commit does not actually exist, so whenever a user clicks the git url on the Dagster Cloud Code Location page, it fails.

Example: Screenshot 2024-04-18 at 14 07 47

Instead, I think the behavior should be to go to the head commit of the PR's branch.

vicyap commented 6 months ago

Hi @shalabhc - do you have any time to help me review this PR? We are currently using a fork with these changes, and it would help us if we can use the main repo so we don't have to maintain a fork.