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

GitHub Action

All in one project

1.0.1

All in one project

arrow-up

All in one project

Add an issue or pull_request to one GitHub Project

Installation

Copy and paste the following snippet into your .yml file.

              

- name: All in one project

uses: masutaka/[email protected]

Learn more about this action in masutaka/github-actions-all-in-one-project

Choose a version

GitHub Actions for all in one Project

Docker Automated buil Docker Stars Docker Pulls License

When you create an issue or pull request, these GitHub Actions always add it to specific GitHub Project.

Usage

Add the following settings to .github/main.workflow in your repository.

In addition you should probably use Automation for GitHub Projects.

Repository project

  1. Set the URL of repository project to PROJECT_URL
  2. Set column name you want issue/pull_request at the beginning to INITIAL_COLUMN_NAME

For issues

workflow "issues" {
  on       = "issues"
  resolves = ["Add an issue to project"]
}

action "Add an issue to project" {
  uses    = "docker://masutaka/github-actions-all-in-one-project"
  secrets = ["GITHUB_TOKEN"]
  args    = ["issue"]

  env = {
    PROJECT_URL         = "https://github.com/masutaka/sandbox-github-actions/projects/2"
    INITIAL_COLUMN_NAME = "To do"
  }
}

For pull requests

workflow "pull_requests" {
  on       = "pull_request"
  resolves = ["Add a pull_request to project"]
}

action "Add a pull_request to project" {
  uses    = "docker://masutaka/github-actions-all-in-one-project"
  secrets = ["GITHUB_TOKEN"]
  args    = ["pull_request"]

  env = {
    PROJECT_URL         = "https://github.com/masutaka/sandbox-github-actions/projects/2"
    INITIAL_COLUMN_NAME = "In progress"
  }
}

Organization-wide project

  1. Set the URL of Organization-wide project to PROJECT_URL
  2. Set column name you want issue/pull_request at the beginning to INITIAL_COLUMN_NAME
  3. Set secrets MY_GITHUB_TOKEN
    1. Create personal access token with repo scope on https://github.com/settings/tokens
    2. Create secret MY_GITHUB_TOKEN on https://github.com/USER/REPO_NAME/settings/secrets. The value is same to personal access token you created the above
    3. Set MY_GITHUB_TOKEN to secrets as follows:

For issues

workflow "issues" {
  on       = "issues"
  resolves = ["Add an issue to project"]
}

action "Add an issue to project" {
  uses    = "docker://masutaka/github-actions-all-in-one-project"
  secrets = ["MY_GITHUB_TOKEN"]
  args    = ["issue"]

  env = {
    PROJECT_URL         = "https://github.com/orgs/example/projects/2"
    INITIAL_COLUMN_NAME = "To do"
  }
}

For pull requests

workflow "pull_requests" {
  on       = "pull_request"
  resolves = ["Add a pull_request to project"]
}

action "Add a pull_request to project" {
  uses    = "docker://masutaka/github-actions-all-in-one-project"
  secrets = ["MY_GITHUB_TOKEN"]
  args    = ["pull_request"]

  env = {
    PROJECT_URL         = "https://github.com/orgs/example/projects/2"
    INITIAL_COLUMN_NAME = "In progress"
  }
}