Add repository input (#58) (#61)

This commit is contained in:
Alex Pearson 2020-12-20 14:44:30 -05:00 committed by GitHub
parent 2cf5c66450
commit affa18ef97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -181,6 +181,7 @@ The following are optional as `step.with` keys
| `files` | String | Newline-delimited globs of paths to assets to upload for release | | `files` | String | Newline-delimited globs of paths to assets to upload for release |
| `name` | String | Name of the release. defaults to tag name | | `name` | String | Name of the release. defaults to tag name |
| `tag_name` | String | Name of a tag. defaults to `github.ref` | | `tag_name` | String | Name of a tag. defaults to `github.ref` |
| `repository` | String | Name of a target repository in `<owner>/<repo>` format. defaults to the current repository
| `fail_on_unmatched_files` | Boolean | Indicator of whether to fail if any of the `files` globs match nothing| | `fail_on_unmatched_files` | Boolean | Indicator of whether to fail if any of the `files` globs match nothing|
💡When providing a `body` and `body_path` at the same time, `body_path` will be attempted first, then falling back on `body` if the path can not be read from. 💡When providing a `body` and `body_path` at the same time, `body_path` will be attempted first, then falling back on `body` if the path can not be read from.

View File

@ -27,6 +27,9 @@ inputs:
fail_on_unmatched_files: fail_on_unmatched_files:
description: 'Fails if any of the `files` globs match nothing. Defaults to false' description: 'Fails if any of the `files` globs match nothing. Defaults to false'
required: false required: false
repository:
description: 'Repository to make releases against, in <owner>/<repo> format'
required: false
env: env:
'GITHUB_TOKEN': 'As provided by Github Actions' 'GITHUB_TOKEN': 'As provided by Github Actions'
outputs: outputs:

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@ export interface Config {
// user provided // user provided
input_name?: string; input_name?: string;
input_tag_name?: string; input_tag_name?: string;
input_repository?: string;
input_body?: string; input_body?: string;
input_body_path?: string; input_body_path?: string;
input_files?: string[]; input_files?: string[];
@ -41,7 +42,7 @@ export const parseConfig = (env: Env): Config => {
return { return {
github_token: env.GITHUB_TOKEN || "", github_token: env.GITHUB_TOKEN || "",
github_ref: env.GITHUB_REF || "", github_ref: env.GITHUB_REF || "",
github_repository: env.GITHUB_REPOSITORY || "", github_repository: env.INPUT_REPOSITORY || env.GITHUB_REPOSITORY || "",
input_name: env.INPUT_NAME, input_name: env.INPUT_NAME,
input_tag_name: env.INPUT_TAG_NAME, input_tag_name: env.INPUT_TAG_NAME,
input_body: env.INPUT_BODY, input_body: env.INPUT_BODY,