Skip to content

Commit 2f8ef64

Browse files
committed
docs: clean writing
1 parent e72c23c commit 2f8ef64

File tree

3 files changed

+63
-53
lines changed

3 files changed

+63
-53
lines changed

README.md

Lines changed: 63 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
# GitHub Actions auto-move-related-issue
66

7-
This is GitHub Actions that sets Assignees on the card for each column of GitHub Project.
7+
This is GitHub Actions that move the open-issue described in the "Issue" paragraph to a specific project column.
8+
9+
The supported action webhook events are `issues` | `pull_request`.
10+
11+
> Note: The development is primarily focused on `closed` events, so it may not work with certain event triggers.
812
9-
Supporting action triggers work when create or move an Issue/PullRequest card or convert a note to an Issue card.
1013

1114
## Screenshot
1215
![DEMO GIF](https://raw.githubusercontent.com/1natsu172/github-action-auto-move-related-issue/d0035515ff6b689b43c0a65e01e3943a8dde9897/media/demo.gif)
@@ -18,97 +21,104 @@ Supporting action triggers work when create or move an Issue/PullRequest card or
1821
example `.github/workflows/auto-move-related-issue.yml`
1922

2023
```yaml
21-
name: "Auto card assign"
24+
name: "Auto move related issue"
2225
on:
23-
project_card:
24-
types: ["created", "moved", "converted"]
26+
pull_request:
27+
types: [closed]
2528

2629
jobs:
27-
card_assign:
30+
auto-move-related-issue:
2831
runs-on: ubuntu-latest
2932
steps:
3033
- uses: 1natsu172/github-action-auto-move-related-issue@v1
31-
id: card_assign_action
34+
id: auto-move-related-issue_action
3235
with:
3336
# github_token: "${{ secrets.GITHUB_TOKEN }}"
34-
config: "auto-move-related-issue.yml"
37+
config: "auto-move-related-issue-config.yml"
38+
```
39+
40+
・Tips
41+
42+
If you only want to run the pull_request on merged, you can write the steps configuration as follows.
43+
44+
```yaml
45+
steps:
46+
- uses: 1natsu172/github-action-auto-move-related-issue@v1
47+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
48+
id: auto-move-related-issue_action
49+
with:
50+
# github_token: "${{ secrets.GITHUB_TOKEN }}"
51+
config: "auto-move-related-issue-config.yml"
3552
```
3653
3754
`with` options
3855

39-
| name | description | default | required | e.g. |
40-
| :----------: | :--------------- | :-----------------------: | :------: | :-------------------------: |
41-
| config | Config file name | `auto-move-related-issue.yml` | true | `auto-move-related-issue-config.yml` |
42-
| github_token | Access token | `${{github.token}}` | true | `${{secrets.ACCESS_TOKEN}}` |
56+
| name | description | default | required | e.g. |
57+
| :----------: | ---------------- | :----------------------------------: | :------: | :--------------------------------: |
58+
| config | Config file name | `auto-move-related-issue-config.yml` | true | `move-related-issue-on-merged.yml` |
59+
| github_token | Access token | `${{github.token}}` | true | `${{secrets.ACCESS_TOKEN}}` |
4360

44-
### Configure assignees for each project column
61+
### Configure target project and column names
4562

46-
example `.github/auto-move-related-issue.yml`
63+
example `.github/auto-move-related-issue-config.yml`
4764

4865
```yaml
49-
kanban1: # Project name
50-
To do: # Column name
51-
- "memberName1" # Login name(assignee name)
52-
In progress:
53-
- "memberName2"
54-
Review in progress:
55-
- "memberName3"
56-
Reviewer approved:
57-
- "memberName1"
58-
- "memberName2"
59-
- "memberName3"
60-
Done: []
66+
projectName: "kanban1"
67+
columnName: "Review in progress"
6168
```
6269

63-
## Config rules
70+
### Please write an `Issue` paragraph in your Issue or PullRequest content
6471

65-
### Follow the config format
72+
**Must write `Issue` paragraph and Issue or PullRequest number or url**
6673

67-
* Please write yaml
68-
* [configure example](https://codebeautify.org/yaml-to-json-xml-csv/cbf4517b)
69-
* Type definition of [Config](https://github.com/1natsu172/github-action-auto-move-related-issue/blob/master/src/types/config.ts) = Result of [yaml to json](https://codebeautify.org/yaml-to-json-xml-csv#)
70-
* assignee names are expressed a `string[]`
74+
example
7175

72-
### Write the exact name
76+
```markdown
77+
# Issue
7378
74-
According to the image below.
79+
#1
80+
#3
81+
https://github.com/sushi-kun/github-projects-lab/issues/5
7582
76-
![project name and column name is here](https://github.com/1natsu172/github-action-auto-move-related-issue/blob/d0035515ff6b689b43c0a65e01e3943a8dde9897/media/project-and-column-name.png?raw=true)
77-
![login name is here](https://github.com/1natsu172/github-action-auto-move-related-issue/blob/d0035515ff6b689b43c0a65e01e3943a8dde9897/media/login-name.png?raw=true)
83+
# Summary
84+
85+
.
86+
.
87+
.
88+
```
7889

79-
**Be careful!**
90+
**This action support single project and single column target.**
8091

81-
* Don't add prefix `@` for login name
82-
* Write the expected assignees for the column
83-
* The Assignees before the move will be deleted
92+
## Config rules
8493

85-
## Behavior
94+
### Write the exact name
8695

87-
The assignees before the move do not remain and update with the expect assignees of the column.
96+
According to the image below.
8897

89-
## FAQ
98+
![project name and column name is here](https://github.com/1natsu172/github-action-auto-move-related-issue/blob/d0035515ff6b689b43c0a65e01e3943a8dde9897/media/project-and-column-name.png?raw=true)
9099

91-
### ・How can I set 0(empty) Assignees?
100+
## Behavior
92101

93-
Please configure as an empty array = `[]`
102+
Only the Issue or PullRequest number or url in the issue paragraph will be targeted. It also ignores issues that have been given keywords to close.
94103

95-
### ・Will the assignees before the card move remain after the move?
104+
> ref: [Closing issues using keywords](https://help.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords)
96105

97-
No, all assignees before the move will be removed.
106+
Support for Issue or PullRequest that has not been added to the target project. It is automatically added to the target column even if it has not been added to the project.
98107

99-
### ・What happens if move a card to an unconfigured column?
108+
## FAQ
100109

101-
The action itself is successful and the assignment process is skipped.
110+
### ・Not moved or some Issue or PullRequest is not moved.
102111

112+
Do you have any extra information in your Issue paragraph other than a number or URL?
113+
It is recommended to describe Issue paragraph as simply as possible, with only the number and URL.
103114

104115

105116
## Support action trigger events
106117

107-
| eventName | action types |
118+
| eventName | action types |
108119
| :----------: | :----------: |
109-
| project_card | moved |
110-
| project_card | created |
111-
| project_card | converted |
120+
| issues | any |
121+
| pull_request | any |
112122

113123
## Versioning
114124

media/content-body-example.png

112 KB
Loading

media/project-and-column-name.png

135 KB
Loading

0 commit comments

Comments
 (0)