Skip to content

Commit 2cae888

Browse files
authored
πŸ”€ Merge pull request #897 from marocchino/owner
✨ owner option
2 parents c0d3b93 + 0bd1af9 commit 2cae888

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

β€ŽREADME.md

+4
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ is explicitly passed, this problem can be solved by just removing it.
191191

192192
**Optional** Pull request number for push event. Note that this has a **lower priority** than the number of a pull_request event.
193193

194+
### `owner`
195+
196+
**Optional** Another repository owner, If not set, the current repository owner is used by default. Note that when you trying changing a repo, be aware that `GITHUB_TOKEN` should also have permission for that repository.
197+
194198
### `repo`
195199

196200
**Optional** Another repository name. Of limited use on GitHub enterprise. If not set, the current repository is used by default. Note that when you trying changing a repo, be aware that `GITHUB_TOKEN` should also have permission for that repository.

β€Ž__tests__/config.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ beforeEach(() => {
1818
afterEach(() => {
1919
jest.resetModules()
2020
delete process.env["GITHUB_REPOSITORY"]
21+
delete process.env["INPUT_OWNER"]
2122
delete process.env["INPUT_REPO"]
2223
delete process.env["INPUT_HEADER"]
2324
delete process.env["INPUT_MESSAGE"]
@@ -38,10 +39,11 @@ afterEach(() => {
3839
})
3940

4041
test("repo", async () => {
42+
process.env["INPUT_OWNER"] = "jin"
4143
process.env["INPUT_REPO"] = "other"
4244
expect(require("../src/config")).toMatchObject({
4345
pullRequestNumber: expect.any(Number),
44-
repo: {owner: "marocchino", repo: "other"},
46+
repo: {owner: "jin", repo: "other"},
4547
header: "",
4648
append: false,
4749
recreate: false,

β€Žaction.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ inputs:
5959
number:
6060
description: "pull request number for push event"
6161
required: false
62+
owner:
63+
description: "Another repo owner, If not set, the current repo owner is used by default. Note that when you trying changing a repo, be aware that GITHUB_TOKEN should also have permission for that repository."
64+
required: false
6265
repo:
63-
description: "other repo name limited use on github enterprise. If not set, the current repo is used by default. Note that When you trying changing a repo, be aware that GITHUB_TOKEN should also use that repo's."
66+
description: "Another repo name limited use on github enterprise. If not set, the current repo is used by default. Note that When you trying changing a repo, be aware that GITHUB_TOKEN should also use that repo's."
6467
required: false
6568
GITHUB_TOKEN:
6669
description: "The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to create or update the comment. This defaults to {{ github.token }}."

β€Ždist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žsrc/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const ignoreEmpty = core.getBooleanInput("ignore_empty", {
3636

3737
function buildRepo(): {repo: string; owner: string} {
3838
return {
39-
owner: context.repo.owner,
39+
owner: core.getInput("owner", {required: false}) || context.repo.owner,
4040
repo: core.getInput("repo", {required: false}) || context.repo.repo
4141
}
4242
}

0 commit comments

Comments
Β (0)