Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Create or Update Project Card

CI GitHub Marketplace

A GitHub action to create or update a project card.

Usage

Create a project card

      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column
          issue-number: 1

Update a project card

If a card already exists in project My project for issue 1, the action will check if the card is in column My second column. If not in the specified column, the action will move the card.

      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My second column
          issue-number: 1

Create a card for all new issues

on:
  issues:
    types: [opened]
jobs:
  createCard:
    runs-on: ubuntu-latest
    steps:
      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column

Create a card for all new pull requests

on:
  pull_request:
    types: [opened]
jobs:
  createCard:
    runs-on: ubuntu-latest
    steps:
      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column
          issue-number: ${{ github.event.number }}

Action inputs

Name Description Default
token GITHUB_TOKEN or a repo scoped PAT. GITHUB_TOKEN
project-number (semi-required) The number of the project. Either project-number OR project-name must be supplied.
project-name (semi-required) The name of the project. Either project-number OR project-name must be supplied. Note that a project's name is not unique. The action will use the first matching project found.
column-name (required) The name of the column to add a card to, or move an existing card to.
repository The GitHub repository containing the issue or pull request. github.repository (current repository)
issue-number The issue or pull request number to associate with the card. github.event.issue.number

Action outputs

The action outputs card-id for use in later workflow steps.

      - name: Create or Update Project Card
        id: coupc
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column
          issue-number: 1
      - name: Check output
        run: echo ${{ steps.coupc.outputs.card-id }}

License

MIT