Coder Social home page Coder Social logo

actions-add-new-issue-to-column's Introduction

Actions-AddNewIssueToColumn

This action automatically adds issues or pull requests to a specific column in a project. A new project card gets created that references the issue or pull request if it doesn't already exist.

The project can be configured at the repository level or at the org level. This action allows you to create new types of automations that are not currently supported with project boards and issues.

Demo

This demo shows a new issue called "Demo Issue" that automatically gets added to column in a project after being created.

Create a PAT with the appropriate permissions

You have to use a custom token that has repo access when using a repository project board or read:org access if using an organization project board. You can add the PAT as a secret in the repository settings page and use it instead of secrets.GITHUB_TOKEN. The token that is normally passed in does not have permissions to search projects to get the appropriate column id so it will fail with a Resource not accessible by integration error.

Inputs

Input Required Description
action-token Yes A token with permissions to use repository or oraganization project board.
project-url Yes The full url of the GitHub project board. Ex. https://github.com/orgs/github/projects/1
column-name Yes The name of the project board column where the issue or pull request should be added.

Example workflow YAML

Example YAML workflow that will run whenever a new issue has been opened. The new issue that causes the workflow to run will be added to the specified column:

on:
  issues:
    types: [opened]
jobs:
  Add_New_Issue_To_Project:
    runs-on: ubuntu-latest
    steps:
    - uses: konradpabjan/[email protected]
      with:
        action-token: "${{ secrets.Access_token }}"
        project-url: "https://github.com/orgs/github/projects/1"
        column-name: "New issues should show up here"

The project-url can be a repository project with a format like: https://github.com/konradpabjan/example/projects/1 or a project linked at the org level with the following format: https://github.com/orgs/exampleOrg/projects/1

Conditionally running the workflow for issues or pull requests

You can select which events trigger this action using the on workflow syntax. For example, starting a workflow file with the following YAML syntax will trigger the workflow when issues or pull requests are opened and reopened.

on:
  issues:
    types: [opened, reopened]
  pull_request:
    types: [opened, reopened]

If your workflow triggers on both issues and pull_requestsbut you'd like to limit a step to run on one of the events, you can use anif` conditional.

For example, if you had two separete project columns for issues and pull requests your workflow might look like this:

on:
  issues:
    types: [opened, reopened]
  pull_request:
    types: [opened, reopened]
jobs:
  Add_New_Issue_To_Project:
    runs-on: ubuntu-latest
    steps:
    - name: Triage pull requests
      if: github.event_name == 'pull_request'
      uses: konradpabjan/[email protected]
      with:
        action-token: "${{ secrets.Access_token }}"
        project-url: "https://github.com/orgs/github/projects/1"
        column-name: "New pull requests should show up here"
    - name: Triage issues
      if: github.event_name == 'issues'
      uses: konradpabjan/[email protected]
      with:
        action-token: "${{ secrets.Access_token }}"
        project-url: "https://github.com/orgs/github/projects/1"
        column-name: "New issues should show up here"

actions-add-new-issue-to-column's People

Contributors

dependabot[bot] avatar konradpabjan avatar rachmari avatar ritchxu avatar

Watchers

 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.