Skip to content

Commit a523cf9

Browse files
author
Alex Page
committed
Document type filter so action runs once
1 parent fa53727 commit a523cf9

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,63 @@ If the `pull_request` or `issue` has a card it will be moved to the column provi
99

1010
## Usage
1111

12-
1. Create a new workflow by adding `.github/workflows/backlog-automation.yml` to your project.
12+
1. Create a new workflow `.yml` file to `.github/workflows/`
1313
2. Create a [project](https://help.github.com/en/articles/about-project-boards) with Columns set up in your repository or organisation.
14-
3. In the `backlog-automation.yml` you have to decide what events and actions are going move an issue or pull request to a column.
14+
3. In the `.yml`file you have to decide what webhook events going move or create a card in a column.
1515

1616

17-
_For example:_
17+
### `.github/workflows/opened-issues-triage.yml`
1818

19-
To move opened issues into the Triage column and assigned pull requests into the To Do column of the Backlog project. You would add the following to the `backlog-automation.yml` file:
19+
Move opened issues into the Triage column of the Backlog project
2020

2121
```yml
22-
name: Automate project columns
22+
name: Move new issues into Triage
2323

24-
on: [issues, pull_request]
24+
on:
25+
issues:
26+
types: [opened]
2527

2628
jobs:
2729
automate-project-columns:
2830
runs-on: ubuntu-latest
2931
steps:
30-
- name: Move new issues into Triage
31-
if: github.event_name == 'issues' && github.event.action == 'opened'
32-
uses: alex-page/[email protected]
32+
- uses: alex-page/[email protected]
3333
with:
3434
project: Backlog
3535
column: Triage
3636
repo-token: ${{ secrets.GITHUB_TOKEN }}
37+
```
38+
39+
### `.github/workflows/assigned-pulls-todo.yml`
40+
41+
Add assigned pull requests into the To Do column of the Backlog project
42+
43+
```yml
44+
name: Move assinged pull requests into To do
45+
46+
on:
47+
pull_request:
48+
types: [assigned]
3749
38-
- name: Move assinged pull requests into To do
39-
if: github.event_name == 'pull_request' && github.event.action == 'assigned'
40-
uses: alex-page/[email protected]
50+
jobs:
51+
automate-project-columns:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: alex-page/[email protected]
4155
with:
4256
project: Backlog
4357
column: To do
4458
repo-token: ${{ secrets.GITHUB_TOKEN }}
4559
```
4660

47-
4861
## Workflow options
4962

5063
These are the options recommended to be changed. For more detailed explanation of the workflow file, check out the [GitHub documentation](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
5164

5265
| Setting | Description | Values |
5366
| --- | --- | --- |
54-
| `on` | When the automation is ran | `[issues, pull_request]` |
55-
| `github.event.name` | The event type | `issues` or `pull_request` |
56-
| `github.event.action` | The [webhook event](https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events) that triggers the automation | `opened`, `assigned`, [...more](https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events) |
67+
| `on` | When the automation is ran | `issues` `pull_request` |
68+
| `types` | The types of activity that will trigger a workflow run. | `created`, `assigned` |
5769
| `project` | The name of the project | `Backlog` |
5870
| `column` | The column to create or move the card to | `Triage` |
5971
| `repo-token` | The personal access token | `${{ secrets.GITHUB_TOKEN }}` |
@@ -82,6 +94,7 @@ GraphqlError: Resource protected by organization SAML enforcement. You must gran
8294
8395
## Release History
8496
97+
- v0.1.1 - Document type filter so action runs once
8598
- v0.1.0 - Add support for user projects
8699
- v0.0.3 - Automatic build before commit
87100
- v0.0.2 - Error handling using GitHub actions

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-project-automation-plus",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "🤖 Automate GitHub Project cards with any webhook event",
55
"private": true,
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)