Skip to content

Commit ed928d9

Browse files
Merge pull request #174 from uluzox/master
2 parents 843eecc + c12554b commit ed928d9

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

__tests__/getInputs.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ it('should parse owner and repo', function() {
5151
expect(inputs).toHaveProperty('repo', 'bar');
5252
});
5353

54+
it('should parse owner and repo for input repository', function() {
55+
const inputs = morph(getInputs, {
56+
...MANDATORY_INPUTS,
57+
INPUT_REPOSITORY: 'my/repository',
58+
});
59+
60+
expect(inputs).toHaveProperty('owner', 'my');
61+
expect(inputs).toHaveProperty('repo', 'repository');
62+
});
63+
5464
it('should default to empty list of reviewers', function() {
5565
const inputs = morph(getInputs, {
5666
...MANDATORY_INPUTS,

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ inputs:
2929
labels:
3030
description: 'A comma-separated list of labels to be set on this PR.'
3131
required: false
32+
repository:
33+
description: 'The repository in which the PR shall be created.'
34+
required: false
3235
outputs:
3336
number:
3437
description: 'Pull Request number'

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/getInputs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ export function getInputs(): Inputs {
2222
const body = getInput('body') || undefined;
2323
const reviewers = getInput('reviewers');
2424
const labels = getInput('labels');
25+
const repository = getInput('repository');
2526

26-
const githubRepository = process.env.GITHUB_REPOSITORY;
27+
const githubRepository = repository || process.env.GITHUB_REPOSITORY;
2728

2829
if (!githubRepository) {
2930
throw new Error('GITHUB_REPOSITORY is not set');

0 commit comments

Comments
 (0)