-
Notifications
You must be signed in to change notification settings - Fork 8
Fix deploy triggered by workflow_dispatch #8
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
Conversation
This would probably be equivalent, but I've never written a GitHub Action so I took the safe route here. `const commitId = isPullRequest ? payload.pull_request.head.sha : github.sha;` Fixes webfactory#7
Hey @mkarnicki, sorry it took me so long to get back to this. The change looks reasonable, although I must admit I always have a hard time figuring out what information to pick from the event context. Could you do me a favor and run the change as suggested on your own repo, using the You should be able to do so by specifying Does it correctly pick up the commit SHA, and is the branch name correct as well? |
I feel you :D! Certainly, I'll do that and report back, thanks for your time! |
Hrm. Doesn't seem to have done the trick. The output is: 🎋 On branch 'main', head commit undefined I printed out the following:
with the output being:
So |
I was able to figure it out by logging github.context while running the workflow. The |
4a61165
to
536b870
Compare
@mpdude I confirm the fix works as expected for both |
Any chance go get it merged :)? We've been using it successfully for a client for a while now :) (both on push and on workflow dispatch). |
We've been using this with success for a while, but our workflows still point at my patched version. Any chance this can get merged, please :)? Thank you for your consideration and have a great day! |
Last polite to call for including this fix. If for some reason this does not match your requirements, we will keep using a fork. Thanks and have a great day! |
Thank you @mkarnicki for your contribution, and sorry for repeatedly losing sight of this! |
Released as |
No problem and thank you for accepting the PR! Have a great day! |
After console logging github.context I found that
sha
lives ongithub.context
notgithub.context.payload
so ifhead_commit
is not defined, we usegithub.context.sha
instead. Thanks for considering this fix.Fixes #7