A GitHub Action help you extract issues from pr commit or title or body.
Please pay attention to the trigger timing
name: PR Extract Issues
on:
pull_request:
types: [opened, edited, synchronize, closed]
jobs:
extract:
runs-on: ubuntu-latest
steps:
- uses: actions-cool/pr-extract-issues@v1
with:
way: 'commit'
issues-labels: 'l1, l2'
remove-labels: 'bug1, bug2'
issues-comment: |
HI。这个 issue: ${number} 已经被修复了。
issues-close: true| Name | Desc | Type | Required |
|---|---|---|---|
| token | GitHub token | string | ✖ |
| way | The way to query issues. Options: title body commit |
string | ✔ |
| filter-label | Further filter issues through label | string | ✖ |
| issues-labels | Extra labels on issues | string | ✖ |
| remove-labels | Remove labels on issues | string | ✖ |
| issues-comment | Extra comment on issues | string | ✖ |
| issues-close | Extra close issues | string | ✖ |
title: The PR title. Will only match like- fix: fix other #123 #456 #789
- Get: 123 456 789
- refctore: use other #222 #333#44
- Get: 222 33344
- So you should start with a space # and end with a space
- fix: fix other #123 #456 #789
body:The PR body- Like: #4
- Branch whole line display with # start
commit: Liketitlefilter-label: Note that github default hooks. That is,fixcloseresolvedirectly followed by issue number will be closed after success mergeissues-labels: Support multiple, need to be separated by commaissues-comment:${number}will be replaced with the current issue numberissues-close: Whether close issue
issues: Get issues numbers
You are very welcome to try it out and put forward your comments. You can use the following methods:
- Report bugs or consult with Issue
- Submit Pull Request to improve the code of
pr-extract-issues
也欢迎加入 钉钉交流群
