-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: try to read ref and sha from event payload if available #889
Conversation
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
==========================================
+ Coverage 49.27% 57.43% +8.16%
==========================================
Files 23 30 +7
Lines 2401 4269 +1868
==========================================
+ Hits 1183 2452 +1269
- Misses 1090 1611 +521
- Partials 128 206 +78
Continue to review full report at Codecov.
|
38ca949
to
a500d90
Compare
Could you add some test cases? |
a500d90
to
80ee997
Compare
This comment has been minimized.
This comment has been minimized.
80ee997
to
bd015ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing test cases
bd015ab
to
538994c
Compare
This comment has been minimized.
This comment has been minimized.
With this change `act` will try to populate the `githubContext.ref` and `githubContext.sha` with values read from the event payload. Caveats: - `page_build` should not have a ref - `status` should not have a ref - `registry_package` should set the ref to the branch/tag but the payload isn't documented - `workflow_call` should set ref to the same value as its caller but the payload isn't documented - most of the events should set the sha to the last commit on the ref but unfortunately the sha is not always included in the payload, therefore we use the sha from the local git checkout Co-Authored-By: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
538994c
to
18c3c61
Compare
@catthehacker I added some tests, can you please take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks more than "some" 😄 thanks a lot
With this change
act
will try to populate thegithubContext.ref
andgithubContext.sha
with values read from the event payload.Caveats:
page_build
should not have a refstatus
should not have a refregistry_package
should set the ref to the branch/tag but thepayload isn't documented
workflow_call
should set ref to the same value as its caller but thepayload isn't documented
but unfortunately the sha is not always included in the payload,
therefore we use the sha from the local git checkout