This actions was designed as a complimentary action for the actions/add-to-project. It will allow to change the status(column) on the new GitHub Projects(beta).
Useful as a part of a workflow which creates a new items in a GitHub Projects(beta) so they can be placed in the desired column
Create a workflow which outputs an itemId for the desired item and specify the required fields.
In the example below the newly created issues with a bug
label would be added to a project and then the "Triage" status will be set to the resulted item.
name: Add bugs to bugs project
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
id: addItem
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: bug, needs-triage
label-operator: OR
- uses: kalgurn/update-project-item-status@main
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
item-id: ${{ steps.addItem.outputs.itemId }}
status: "Triage"
-
project-url
(required) is the URL of the GitHub project to add issues to.
eg: https://github.com/orgs|users//projects/ -
github-token
(required) is a personal access token with therepo
,write:org
andread:org
scopes.
See Creating a PAT and adding it to your repository for more details -
item-id
(required) is an ID of the item which requires a status change.
Usually obtained through an API -
status
(required) desired status to be set for the item. Must be an existing project status
-
create a new personal access token with
repo
,write:org
andread:org
scopes
See Creating a personal access token for more information -
add the newly created PAT as a repository secret, this secret will be referenced by the github-token input
See Encrypted secrets for more information
To get started contributing to this project, clone it and install dependencies. Note that this action runs in Node.js 16.x, so we recommend using that version of Node (see "engines" in this action's package.json for details).
> git clone https://github.com/kalgurn/update-project-item-status
> cd add-to-project
> npm install
Or, use GitHub Codespaces.
See the toolkit documentation for the various packages used in building this action.
Actions are run from GitHub repositories, so we check in the packaged action in the "dist/" directory.
> npm run build
> git add lib dist
> git commit -a -m "Build and package"
> git push origin releases/v1
Now, a release can be created from the branch containing the built action.
The scripts and documentation in this project are released under the MIT License