You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
All in one project
1.0.1
When you create an issue or pull request, these GitHub Actions always add it to specific GitHub Project.
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"
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"
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 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"
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"
secrets = ["MY_GITHUB_TOKEN"]
args = ["pull_request"]
env = {
PROJECT_URL = "https://github.com/orgs/example/projects/2"
INITIAL_COLUMN_NAME = "In progress"
}
}