A GitHub Action help you set issue's properties (labels and milestone) to pull requst.
This is a fork of actions-cool/pr-extract-issues.
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: ceskyDJ/pr-set-issue-properties@v1.2.0
with:
way: 'commit'
issues-labels: 'l1, l2'
issues-comment: |
Linked pull request: ${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 | β |
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: actions-cool#4
- Support for Github issue linking (
close #n
,fix #n
,resolve #n
, ...) - New linking (without closing issues):
issue #n
,task #n
commit
: Liketitle
filter-label
: Note that github default hooks. That is,fix
close
resolve
directly 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 pull request numberissues-close
: Whether close issue
issues
: Get issues numbers