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

feat: update default value of git_ref 🧷 #190

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Conversation

jamacku
Copy link
Member

@jamacku jamacku commented May 29, 2024

By default use github.base_ref and use master as a fallback.

This will primarily help when running on pull_request_target.

@jamacku jamacku added the type: feature New feature or request label May 29, 2024
@jamacku jamacku requested a review from phracek May 29, 2024 08:31
@jamacku jamacku linked an issue May 29, 2024 that may be closed by this pull request
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.38%. Comparing base (60d633f) to head (8fb24e0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
+ Coverage   88.33%   88.38%   +0.05%     
==========================================
  Files          10       10              
  Lines         686      689       +3     
  Branches       72       73       +1     
==========================================
+ Hits          606      609       +3     
  Misses         78       78              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/action.ts Outdated Show resolved Hide resolved
@LecrisUT
Copy link

Also, you also have access to these variables within the typescript code:
https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L6-L24

Might be good, because there you can actually check what trigger it was and so on.

action.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jamacku jamacku force-pushed the gitref branch 2 times, most recently from 1f5ad9d to e273c58 Compare June 11, 2024 08:34
@jamacku

This comment was marked as outdated.

@jamacku

This comment was marked as off-topic.

@jamacku jamacku marked this pull request as ready for review June 11, 2024 12:47
By default use `github.ref` and use `master` as a fallback.
@zmiklank
Copy link
Collaborator

I think this is a breaking change. I would consider releasing it with tfaga 3.0 sometime in the future (although 3.0 is not yet even planned).

@jamacku
Copy link
Member Author

jamacku commented Jun 20, 2024

I don't think this is a breaking change, but it changes behavior a bit and might surprise some users.

@jamacku jamacku added type: breaking and removed type: feature New feature or request labels Jun 20, 2024
@LecrisUT
Copy link

I don't think this is a breaking change, but it changes behavior a bit and might surprise some users.

Initially I thought so too, but it is a breaking change because it changes from master -> github.ref, which at minimum will affect PR builds.

@jamacku
Copy link
Member Author

jamacku commented Jun 20, 2024

Initially I thought so too, but it is a breaking change because it changes from master -> github.ref, which at minimum will affect PR builds.

But only in the sense that TF would be using plans from the PR branch, right?

@LecrisUT
Copy link

Initially I thought so too, but it is a breaking change because it changes from master -> github.ref, which at minimum will affect PR builds.

But only in the sense that TF would be using plans from the PR branch, right?

As far as I can think of that would be the only implication, but even there that is quite limited for repos that have master as the main branch as that is being discouraged. You may also have discrepancy when it is run on tag.

But, why guess, there are only 28 instances of the action usage: https://sourcegraph.com/search?q=context:global+++%22uses:+sclorg/testing-farm-as-github-action%22+&patternType=keyword&sm=0

@phracek
Copy link
Member

phracek commented Jul 2, 2024

For sure I would add it into v3. Let's add it there for sure.

@phracek
Copy link
Member

phracek commented Jul 2, 2024

[test]

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

Tests are passing. Let's get merge it and release v3.

@phracek phracek merged commit 8e90696 into sclorg:main Jul 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get git_url and git_ref from the current repo
4 participants