⚠️ This repository is obsolete. I recommend to use https://github.com/philschatz/project-bot.
Automatically add an issue or pull request to specific GitHub Project when you create them.
Add the following settings to .github/main.workflow in your repository.
In addition you should probably use Automation for GitHub Projects.
- Set the URL of repository project to
PROJECT_URL
- Set column name you want issue/pull_request at the beginning to
INITIAL_COLUMN_NAME
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"
}
}
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"
}
}
- Set the URL of User owned project to
PROJECT_URL
- Set column name you want issue/pull_request at the beginning to
INITIAL_COLUMN_NAME
- Set secrets
MY_GITHUB_TOKEN
- Create personal access token with
repo
scope on https://github.com/settings/tokens - 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 - Set
MY_GITHUB_TOKEN
tosecrets
as follows:
- Create personal access token with
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"
}
}
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"
}
}
- Set the URL of Organization-wide project to
PROJECT_URL
- Set column name you want issue/pull_request at the beginning to
INITIAL_COLUMN_NAME
- Set secrets
MY_GITHUB_TOKEN
- Create personal access token with
repo
scope on https://github.com/settings/tokens - 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 - Set
MY_GITHUB_TOKEN
tosecrets
as follows:
- Create personal access token with
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"
}
}
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"
}
}