Skip to content

Commit

Permalink
Add repository input (#58) (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
NAlexPear authored Dec 20, 2020
1 parent 2cf5c66 commit affa18e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| `name` | String | Name of the release. defaults to tag name |
| `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|

💡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.
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
fail_on_unmatched_files:
description: 'Fails if any of the `files` globs match nothing. Defaults to false'
required: false
repository:
description: 'Repository to make releases against, in <owner>/<repo> format'
required: false
env:
'GITHUB_TOKEN': 'As provided by Github Actions'
outputs:
Expand All @@ -37,4 +40,4 @@ runs:
main: 'dist/index.js'
branding:
color: 'green'
icon: 'package'
icon: 'package'
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Config {
// user provided
input_name?: string;
input_tag_name?: string;
input_repository?: string;
input_body?: string;
input_body_path?: string;
input_files?: string[];
Expand Down Expand Up @@ -41,7 +42,7 @@ export const parseConfig = (env: Env): Config => {
return {
github_token: env.GITHUB_TOKEN || "",
github_ref: env.GITHUB_REF || "",
github_repository: env.GITHUB_REPOSITORY || "",
github_repository: env.INPUT_REPOSITORY || env.GITHUB_REPOSITORY || "",
input_name: env.INPUT_NAME,
input_tag_name: env.INPUT_TAG_NAME,
input_body: env.INPUT_BODY,
Expand Down

0 comments on commit affa18e

Please sign in to comment.