This repository has been archived by the owner on Oct 17, 2023. It is now read-only.
Create documentation issue #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create documentation issue | |
on: | |
workflow_dispatch: | |
inputs: | |
pr-number: | |
description: The number of the PR that needs to be documented | |
required: true | |
type: string | |
permissions: | |
issues: write | |
contents: read | |
jobs: | |
create-issue: | |
name: Create issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project to access template | |
uses: actions/checkout@v3 | |
- name: Check if issue exists | |
id: issue-exists | |
run: | | |
ISSUE_URL=$(gh issue list --repo ${{ github.repository }} --state all --search "Document Noir PR ${{ inputs.pr-number }} in:title" --json url --jq ".[0].url") | |
echo "issue-url=$ISSUE_URL" >> "$GITHUB_OUTPUT" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create issue | |
if: ${{ steps.issue-exists.outputs.issue-url == '' }} | |
uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR: ${{ inputs.pr-number }} | |
with: | |
filename: .github/MIGRATED_ISSUE.md | |
- name: Re-open issue | |
if: ${{ steps.issue-exists.outputs.issue-url != '' }} | |
run: | | |
gh issue reopen ${{ steps.issue-exists.outputs.issue-url }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |