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

Add repository input (#58) #61

Merged
merged 1 commit into from Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
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
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
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