GithubHelp home page GithubHelp logo

dependabot-pr-issue-creator's Introduction

Description

This action allows you to automatically create an issue on a reviewer's Linear/Jira board when a reviewer is added to a pull request with a '๐Ÿ“ฆ dependencies' label.

Setup

Before the action can be used properly, the following Github secrets must be created on the repository:

  • GITHUB_TOKEN
  • JIRA_API_EMAIL
  • JIRA_API_TOKEN
  • LINEAR_API_TOKEN

In addition, the CONFIG_FILE environment variable within the action.yml file must be pointed to the path of the config file (default path is reviewers-info.json), and its contents must be populated with the appropriate reviewer information. An example of the file format can be found in this repository at ".github/reviewers-info.json".

For Jira, obtaining the information is quite simple. For the project key, you can navigate to the team's project board. For user Jira ID's, you can navigate to that user's profile. In both cases, the desired information can be found at the end of the URL.

For Linear, the simplest way to obtain the project and user IDs is through the Linear API. Examples of how to query team IDs and user IDs can be found here: https://developers.linear.app/docs/graphql/working-with-the-graphql-api

Usage

on:
  pull_request:
    branches: [ next ]
    types: [ review_requested ]

jobs:
  create-issue:
    if: contains( github.event.pull_request.labels.*.name, '๐Ÿ“ฆ dependencies' )
    env: 
      CONFIG_FILE: .github/reviewers-info.json
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        
      - name: Setup Python
        uses: actions/setup-python@v2
        
      - name: install requests
        run: pip install requests
        
      - name: Create Issue
        run: |
          if [ ${{ env.WHICH }} == "JIRA" ]
          then
            python ./bin/create-issue-from-dependency-PR/create-jira-ticket.py -e $GITHUB_EVENT_PATH -u $JIRA_API_EMAIL -p $JIRA_API_TOKEN -config ${{ env.CONFIG_FILE }} -gt ${{ env.GITHUB_TOKEN }} -ref $GITHUB_REF
          elif [ ${{ env.WHICH }} == "LINEAR" ]
          then
            python ./bin/create-issue-from-dependency-PR/create-linear-issue-for-dependencies-pr.py -e $GITHUB_EVENT_PATH -p $LINEAR_API_TOKEN -config ${{ env.CONFIG_FILE }} -gt ${{ env.GITHUB_TOKEN }} -ref $GITHUB_REF
          fi
        env: 
          JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
          JIRA_API_EMAIL: ${{ secrets.JIRA_API_EMAIL }}
          LINEAR_API_TOKEN: ${{ secrets.LINEAR_API_TOKEN }} 
          WHICH: LINEAR

dependabot-pr-issue-creator's People

Contributors

sidney98204 avatar

Watchers

 avatar  avatar  avatar  avatar  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.