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

Introducting new variable GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT #46

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Introducting new variable GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT #46

merged 2 commits into from
Jan 12, 2021

Conversation

MadJlzz
Copy link
Contributor

@MadJlzz MadJlzz commented Jan 6, 2021

PR solves #45

@rlespinasse

I had some hard time testing to be honnest (and I am still not sure the right way to test that unless running the action directly on GitHub)

I added 2 dependencies:

  • @actions/github is used to get the context of why an action was triggered
  • @octokit/webhooks to get the typings for WebhookPayloadPullRequest

Sadly, all typings are not present in @action/core 😭
There is a reference to add it to the toolkit library for action here.

For linting errors, I let you tell me which tool you are using for that so that I can fix any errors that will surely show up in the pipeline. (and I will add that in DEVELOPERS.md as well 😀)

@rlespinasse
Copy link
Owner

Hello, I think you can simplify this by using eventData.hasOwnProperty('pull_request') like for GITHUB_EVENT_REF_SLUG. This will enable the support of all type of events who contains an pull_request object.

@MadJlzz
Copy link
Contributor Author

MadJlzz commented Jan 9, 2021

Indeed. I am so bad with JavaScript, sorry about that 😬

@rlespinasse
Copy link
Owner

No need to be sorry about that, me too i'm not fluent in Javascript.
Can you rebase your branch on top of the default branch, I just commit a fix in the Linter configuration.

@MadJlzz
Copy link
Contributor Author

MadJlzz commented Jan 11, 2021

I may have messed up with the rebase. I made a clean branch feat/github_sha_pr_event_2. Weird enough, I cannot change the branch comparison from this PR. Can you check ?

@rlespinasse
Copy link
Owner

@MadJlzz I can't change the branch in your PR. You can fix the feat/github_sha_pr_event branch with the following commands

$ git checkout feat/github_sha_pr_event
$ git reset --hard feat/github_sha_pr_event_2
$ git push --force origin feat/github_sha_pr_event

@MadJlzz
Copy link
Contributor Author

MadJlzz commented Jan 11, 2021

@rlespinasse done! Don't know why but the linting still fails. Even some piece that I didn't touch

@rlespinasse
Copy link
Owner

Since we use Prettier as formatter, the linter need more configuration to correctly manage this. I will merge this PR.

@rlespinasse rlespinasse self-requested a review January 12, 2021 09:21
@rlespinasse rlespinasse merged commit 5b9fe60 into rlespinasse:v3.x Jan 12, 2021
@rlespinasse rlespinasse linked an issue Jan 12, 2021 that may be closed by this pull request
@rlespinasse
Copy link
Owner

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

GITHUB_SHA different value for PR events
2 participants