Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

masutaka/github-actions-all-in-one-project

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This repository is obsolete. I recommend to use https://github.com/philschatz/project-bot.

GitHub Actions for all in one Project

Docker Automated buil Docker Stars Docker Pulls License

Automatically add an issue or pull request to specific GitHub Project when you create them.

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:1.1.0"
  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:1.1.0"
  secrets = ["GITHUB_TOKEN"]
  args    = ["pull_request"]

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

User owned project

  1. Set the URL of User owned 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:1.1.0"
  secrets = ["MY_GITHUB_TOKEN"]
  args    = ["issue"]

  env = {
    PROJECT_URL         = "https://github.com/users/masutaka/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:1.1.0"
  secrets = ["MY_GITHUB_TOKEN"]
  args    = ["pull_request"]

  env = {
    PROJECT_URL         = "https://github.com/users/masutaka/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:1.1.0"
  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:1.1.0"
  secrets = ["MY_GITHUB_TOKEN"]
  args    = ["pull_request"]

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

About

Automatically add an issue or pull request to specific GitHub Project when you create them.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published