Skip to content

Commit 324cb2b

Browse files
authored
Don't require a project owner
1 parent 91ea6d1 commit 324cb2b

File tree

5 files changed

+40
-2013
lines changed

5 files changed

+40
-2013
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,51 @@ An action to remove an issue from a classic/V1 project board.
55
## Inputs
66

77
- `issue-number` - The number of the issue or pull request to remove
8-
- `project-owner` - The organization that contains the project
98
- `project-number` - The number of the project board
109
- `token` - An authentication token with access to the project board and issue/pull request
1110

11+
`project-owner` can be set if the project board is not in the current organization.
12+
1213
`issue-owner` and `issue-repository` can be specified if the issue or pull request does not exist in the workflow's repository.
1314

1415
Use `fail-not-found: true` if you want the action to fail if the issue or pull request does not exist on the project board.
1516

1617
## Usage
1718

18-
### Remove an issue from a project board
19+
### Remove an issue from a project in the current organization
20+
21+
```yaml
22+
- uses: joshmgross/remove-from-project-classic@main
23+
with:
24+
project-number: 123
25+
issue-number: 10
26+
token: ${{ secrets.PROJECT_TOKEN }}
27+
```
28+
29+
### Remove an issue form a project another organization
1930
2031
```yaml
21-
- name: Post message
22-
uses: joshmgross/remove-from-project-classic@main
32+
- uses: joshmgross/remove-from-project-classic@main
2333
with:
24-
issue-number: 1234
2534
project-owner: github
26-
project-number: 5678
35+
project-number: 456
36+
issue-number: 16
37+
token: ${{ secrets.PROJECT_TOKEN }}
38+
```
39+
40+
### Remove an issue from a separate repository
41+
42+
```yaml
43+
- uses: joshmgross/remove-from-project-classic@main
44+
with:
45+
project-number: 123
46+
issue-owner: actions
47+
issue-repository: cache
48+
issue-number: 32
2749
token: ${{ secrets.PROJECT_TOKEN }}
2850
```
2951
30-
## Not supported (yet)
52+
## Not supported yet
3153
3254
- User and repository project boards
3355
- Project cards that are not issues or pull requests

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ inputs:
77
description: 'The number of the issue or pull request to remove.'
88
issue-owner:
99
required: false
10-
description: 'The owner of the issue or pull request to remove. Deafults to the current repository owner.'
10+
description: 'The owner of the issue or pull request to remove. Defaults to the current repository owner.'
1111
issue-repository:
1212
required: false
1313
description: 'The repository of the issue or pull request to remove. Defaults to the current repository.'
1414
project-owner:
15-
required: true
15+
required: false
1616
description: 'The organization that contains the project.'
1717
project-number:
1818
required: true

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10534,9 +10534,12 @@ async function run() {
1053410534
throw new Error("issue-number must be a number");
1053510535
}
1053610536
const token = core.getInput("token", { required: true });
10537-
const projectOwner = core.getInput("project-owner", { required: true });
1053810537
const projectNumber = Number(core.getInput("project-number", { required: true }));
1053910538
const currentRepository = github.context.payload.repository;
10539+
const projectOwner = core.getInput("project-owner") || currentRepository?.owner.login;
10540+
if (!projectOwner) {
10541+
throw new Error("project-owner must be specified, unable to determine from context");
10542+
}
1054010543
const issueOwner = core.getInput("issue-owner") || currentRepository?.owner.login;
1054110544
const issueRepository = core.getInput("issue-repository") || currentRepository?.name;
1054210545
if (!issueOwner || !issueRepository) {

0 commit comments

Comments
 (0)