Skip to content

ashwoods/update-project-item-status

 
 

Repository files navigation

typescript-action status

kalgurn/update-project-item-status

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

Usage

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"

Inputs

  • 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 the repo, write:org and read: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

Creating a PAT and adding it to your repository

Development

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.

Publish to a distribution branch

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.

License

The scripts and documentation in this project are released under the MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.6%
  • JavaScript 1.4%