chore: Release/1.52.1 #994
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: Label PRs | |
on: | |
pull_request: | |
types: [labeled] | |
branches: | |
- main | |
jobs: | |
create-docs-issue: | |
if: github.event.label.name == 'needs docs' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.FLIPT_RELEASE_BOT_APP_ID }} | |
private_key: ${{ secrets.FLIPT_RELEASE_BOT_APP_PEM }} | |
installation_id: ${{ secrets.FLIPT_RELEASE_BOT_INSTALLATION_ID }} | |
- name: Check for existing issues | |
id: check-issues | |
env: | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
pr_title=$(jq -r .pull_request.title < $GITHUB_EVENT_PATH) | |
issue_title="Document: $pr_title" | |
existing_issue=$(gh issue list --repo ${{ github.repository_owner }}/docs --search "$issue_title" --json title --jq '.[0].title') | |
echo "::set-output name=issue_exists::$existing_issue" | |
- name: Create documentation issue | |
if: steps.check-issues.outputs.issue_exists == '' | |
env: | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
pr_title=$(jq -r .pull_request.title < $GITHUB_EVENT_PATH) | |
pr_url=$(jq -r .pull_request.html_url < $GITHUB_EVENT_PATH) | |
issue_title="Document: $pr_title" | |
issue_body="This issue was created to document the following pull request: $pr_url" | |
gh issue create --title "$issue_title" --body "$issue_body" --repo ${{ github.repository_owner }}/docs |