Skip to content

docs: update docs

docs: update docs #2

Workflow file for this run

name: Close Issue on PR Merge
on:
pull_request:
types:
- closed
jobs:
close_issue:
runs-on: ubuntu-latest
steps:
- name: Check if PR is merged
id: pr_check
run: echo "is_merged=${{ github.event.pull_request.merged }}" >> $GITHUB_ENV
- name: Close Issue
if: ${{ env.pr_check == 'true' }}
run: |
# Extract the issue number from the pull request description
ISSUE_NUMBER=$(grep -oP '(?<=#)\d+' "${{ github.event.pull_request.body }}" | head -n1)
# Close the referenced issue
if [[ $ISSUE_NUMBER ]]; then
echo "Closing Issue #$ISSUE_NUMBER"
curl -X POST -H "Authorization: token ${{ secrets.GH_TOKEN }}" -d '{"state": "closed"}' "https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER"
else
echo "No referenced issue found in the pull request description."
fi