Add optional pr-number input#8
Merged
duarten merged 2 commits intoumani:masterfrom Apr 19, 2020
pruett:pruett.optional-pr-number
Merged
Add optional pr-number input#8duarten merged 2 commits intoumani:masterfrom pruett:pruett.optional-pr-number
pr-number input#8duarten merged 2 commits intoumani:masterfrom
pruett:pruett.optional-pr-number
Conversation
duarten
reviewed
Apr 19, 2020
Member
duarten
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks great, and it makes a lot of sense to decouple the action from a particular context.
src/main.ts
Outdated
| core.setFailed("Could not get pull request number from context, exiting") | ||
| core.setFailed( | ||
| `Could not get pull request from ${prNumberInput ? "the provided pr number" : "context"}, exiting`, | ||
| ) |
Member
There was a problem hiding this comment.
Provided you have time, it would be nice to extract this to its own function, fetchPr(): Promise<SomePrType> or similar.
pruett
commented
Apr 19, 2020
| import { WebhookPayload } from "@actions/github/lib/interfaces" | ||
|
|
||
| const octokit = new Octokit() | ||
| type GetPullResponseDataType = GetResponseDataTypeFromEndpointMethod<typeof octokit.pulls.get> |
Contributor
Author
There was a problem hiding this comment.
I followed the process of generating the octokit here. Not sure if there's a cleaner way to do this.
Member
There was a problem hiding this comment.
Actually, it doesn't seem to compile. The fix is easy though, I think we can just drop this type since it's compatible with WebhookPayload["pull_request"].
duarten
pushed a commit
that referenced
this pull request
Apr 19, 2020
This optional input allows users to run this action outside of the pull_request event context. Certain pipelines are not conducive to running solely inside the pull_request event. For example, we are creating a custom deployment event triggered by a Netlify webhook when the build succeeds on their end. After this event triggers, we'd then like to use the changed files of the PR alongside the deployed preview url.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This optional input allows users to run this action outside of the
pull_requestevent context.Reasoning:
Certain pipelines are not conducive to running solely inside the
pull_requestevent. For example, we are creating a customdeploymentevent triggered by a Netlify webhook when the build succeeds on their end. After this event triggers, we'd then like to use the changed files of the PR alongside the deployed preview url.