Use https://github.com/actions/add-to-project
This is a simple github action to add something to an organization level github project. It's designed to work with PRs or Issues, though could be adapted to other kinds of events. It was written so that workflow action, can avoid checkouts.
Using this requires a PAT with appropriate permissions. I believe that you can use this link to create one. At this time, that appears to be:
repo
(yes, all of it)write:org
read:org
It was adapted from the documented example.
(The content_id is determined from the active github context.)
on:
pull_request:
branches:
- main
- master
jobs:
add_to_board:
runs-on: ubuntu-latest
steps:
- uses: kolide/add-to-project-action@v1
with:
token: ${{secrets.PROJECT_WORKFLOW_PAT}}
organization: kolide
project_number: 9
In many of our use cases, it's desirable to filter by label. This supports a simple check against the name. Specify as a comma delimited string. If the name has a space, it should keep the space. eg:
on:
issues:
types: [reopened, labeled]
pull_request_target:
types: [reopened, labeled]
branches:
- main
- master
jobs:
add_to_board:
runs-on: ubuntu-latest
steps:
- uses: kolide/add-to-project-action@v1
with:
token: ${{secrets.PROJECT_WORKFLOW_PAT}}
organization: kolide
project_number: 9
only_labeled: "bug,help wanted"
This repo stems from the github example javascript action. Reminders about the commands:
| Update Dependencies | npm install
|
| Run Tests (there are none | npm test
|
| build / package for distribution | npm run prepare
|
| tag and version | (normal git commands |