Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kentlouisetonino/f3fe6337d04a6caddeba35ba143df2d0 to your computer and use it in GitHub Desktop.
Save kentlouisetonino/f3fe6337d04a6caddeba35ba143df2d0 to your computer and use it in GitHub Desktop.
Create Issue when Dependabot opens PR
name: CreateDependabotIssue
on:
workflow_dispatch:
pull_request:
branches:
- master
types: [ opened, reopened]
jobs:
issue:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v2
if: github.event.pull_request.user.login == 'dependabot[bot]'
- name: Open issue if Dependabot PR
if: github.event.pull_request.user.login == 'dependabot[bot]'
env:
pr_title: ${{github.event.pull_request.title}}
pr_number: ${{github.event.pull_request.number}}
pr_url: ${{github.event.pull_request.url}}
run: |
title="Dependabot PR $pr_title opened"
body="Dependabot has opened PR #$pr_number
Link: $pr_url"
gh issue create --title "$title" --body "$body"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment