Skip to content

Commit a721689

Browse files
committed
prep version 1.2.0
1 parent 24b62d8 commit a721689

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
name: Assign to One Project
1515
steps:
1616
- name: Assign NEW issues and NEW pull requests to project 2
17-
uses: srggrs/assign-one-project-github-action@1.1.3
17+
uses: srggrs/assign-one-project-github-action@1.2.0
1818
if: github.event.action == 'opened'
1919
with:
2020
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
2121

2222
- name: Assign issues and pull requests with `bug` label to project 3
23-
uses: srggrs/assign-one-project-github-action@1.1.3
23+
uses: srggrs/assign-one-project-github-action@1.2.0
2424
if: |
2525
contains(github.event.issue.labels.*.name, 'bug') ||
2626
contains(github.event.pull_request.labels.*.name, 'bug')

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[docker]: https://hub.docker.com/r/srggrs/assign-one-project-github-action
1010
[license]: https://github.com/srggrs/assign-one-project-github-action/blob/master/LICENSE
1111

12-
Automatically add an issue or pull request to specific [GitHub Project](https://help.github.com/articles/about-project-boards/) when you __create__ them. By default, the issues are assigned to the `To do` column and the pull requests to the `In progress` one, so make sure you have those columns in your project dashboard.
12+
Automatically add an issue or pull request to specific [GitHub Project](https://help.github.com/articles/about-project-boards/) when you __create__ and/or __label__ them. By default, the issues are assigned to the `To do` column and the pull requests to the `In progress` one, so make sure you have those columns in your project dashboard. But the workflow allowed you to specify the column name as input, so you can assign the issues/PRs based on a set of conditions to a specific column of a specific project.
1313

1414
## Acknowledgment & Motivations
1515

@@ -50,13 +50,13 @@ jobs:
5050
name: Assign to One Project
5151
steps:
5252
- name: Assign NEW issues and NEW pull requests to project 2
53-
uses: srggrs/assign-one-project-github-action@1.1.2
53+
uses: srggrs/assign-one-project-github-action@1.2.0
5454
if: github.event.action == 'opened'
5555
with:
5656
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
5757

5858
- name: Assign issues and pull requests with `bug` label to project 3
59-
uses: srggrs/assign-one-project-github-action@1.1.2
59+
uses: srggrs/assign-one-project-github-action@1.2.0
6060
if: |
6161
contains(github.event.issue.labels.*.name, 'bug') ||
6262
contains(github.event.pull_request.labels.*.name, 'bug')
@@ -65,15 +65,20 @@ jobs:
6565
column_name: 'Labeled'
6666
```
6767
68-
You can use any combination of conditions, for example to move only the issues to a specific project:
68+
#### __Notes__
69+
Be careful of using the coditions above (opened and labeled issues/PRs) because in such workflow, if the issue/PR is opened and labeled at the same time, it will be assigned to __both__ projects!
70+
71+
72+
You can use any combination of conditions. For example, to assign new issues or issues labeled with 'mylabel' to a project column, use:
6973
```yaml
7074
...
7175

7276
if: |
73-
github.event.action == 'opened' &&
74-
contains(github.event.issue.labels.*.name, 'mylabel') ||
75-
contains(github.event.pull_request.labels.*.name, 'mylabel')
76-
77+
github.event == 'issue' &&
78+
(
79+
github.event.action == 'opened' ||
80+
contains(github.event.issue.labels.*.name, 'mylabel')
81+
)
7782
...
7883
```
7984

@@ -98,13 +103,13 @@ jobs:
98103
name: Assign to One Project
99104
steps:
100105
- name: Assign NEW issues and NEW pull requests to project 2
101-
uses: srggrs/assign-one-project-github-action@1.1.2
106+
uses: srggrs/assign-one-project-github-action@1.2.0
102107
if: github.event.action == 'opened'
103108
with:
104109
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
105110

106111
- name: Assign issues and pull requests with `bug` label to project 3
107-
uses: srggrs/assign-one-project-github-action@1.1.2
112+
uses: srggrs/assign-one-project-github-action@1.2.0
108113
if: |
109114
contains(github.event.issue.labels.*.name, 'bug') ||
110115
contains(github.event.pull_request.labels.*.name, 'bug')

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# action.yml
22
name: 'Assign to One Project'
3-
description: 'Assign Issue or Pull Request based on actoin to selected project dashboard column'
3+
description: 'Assign new/labeled Issue or Pull Request to a specific project dashboard column'
44
author: srggrs
55
inputs:
6-
project: # id of input
6+
project:
77
description: 'The url of the project to be assigned to.'
88
required: true
99
column_name:
@@ -12,7 +12,7 @@ inputs:
1212

1313
runs:
1414
using: 'docker'
15-
image: 'docker://srggrs/assign-one-project-github-action:1.1.3'
15+
image: 'docker://srggrs/assign-one-project-github-action:1.2.0'
1616
args:
1717
- ${{ inputs.project }}
1818
- ${{ inputs.column_name }}

0 commit comments

Comments
 (0)