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

Get default branch from deployment event #18

Merged
merged 3 commits into from
Jul 29, 2022

Conversation

rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Jul 28, 2022

This PR utilizes the default_branch given to us by GitHub to populate the branch (previously main) field when getting diffs.

The ability to override the branch is kept because it was easy and could be useful in some cases, but in most cases users won't need it.

Test branch at iterative/cml.dev#287

@rogermparent rogermparent self-assigned this Jul 28, 2022
@rogermparent rogermparent marked this pull request as draft July 28, 2022 17:52
@rogermparent rogermparent requested a review from a team July 29, 2022 00:43
@rogermparent rogermparent marked this pull request as ready for review July 29, 2022 00:43
Copy link
Contributor

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

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

lgtm

description: "The main branch of this repository"
default: "main"
description: "The branch to compare against when finding new links to check"
default: "${{ github.event.repository.default_branch }}"
Copy link
Contributor

@casperdcl casperdcl Jul 29, 2022

Choose a reason for hiding this comment

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

surprised that this is accessible from on.workflow_call.inputs.<inputs_id>.default but according to https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability this should actually work fine :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was skeptical at first as well and was ready to just axe the option, but I made sure to test this out first and it surprisingly went just fine.

Copy link
Contributor

@yathomasi yathomasi left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@rogermparent rogermparent merged commit 8c8403a into master Jul 29, 2022
@casperdcl casperdcl deleted the auto-detect-diff-branch-in-action branch October 28, 2022 18:29
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