Coder Social home page Coder Social logo

armando170a / github-actions-all-in-one-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masutaka/github-actions-all-in-one-project

0.0 0.0 0.0 23 KB

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

License: MIT License

Dockerfile 11.08% Shell 67.11% HCL 21.80%

github-actions-all-in-one-project's Introduction

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"
  }
}

github-actions-all-in-one-project's People

Contributors

masutaka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.