chore: create doc issue on pr merge
This commit is contained in:
parent
cc55ebf1fd
commit
48d6e0779a
1 changed files with 20 additions and 3 deletions
23
.github/workflows/docs-issue.yml
vendored
23
.github/workflows/docs-issue.yml
vendored
|
|
@ -1,15 +1,32 @@
|
|||
name: Create Documentation Issue
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
pull_request_target:
|
||||
types: [closed]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
check-label-and-create-issue:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'needs documentation'
|
||||
if: github.event.pull_request.merged == true
|
||||
steps:
|
||||
- name: Check for 'needs documentation' label
|
||||
id: check-label
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN }}
|
||||
script: |
|
||||
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number
|
||||
});
|
||||
const hasLabel = labels.some(label => label.name === 'needs documentation');
|
||||
return hasLabel;
|
||||
result-encoding: string
|
||||
|
||||
- name: Create Docs Issue
|
||||
if: steps.check-label.outputs.result == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue