name: Format Issue Body on: issues: types: [opened] permissions: contents: read issues: write concurrency: group: issue-format-${{ github.event.issue.number }} cancel-in-progress: true jobs: format: runs-on: ubuntu-latest if: github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'bug') permissions: contents: read issues: write steps: - name: Checkout repository uses: actions/checkout@v6 - name: Parse issue form body uses: stefanbuck/github-issue-parser@v3 id: parse with: template-path: .github/ISSUE_TEMPLATE/01-bug_report.yml - name: Build formatted issue body id: summary env: DESCRIPTION: ${{ steps.parse.outputs.issueparser_description }} REPRODUCTION_STEPS: ${{ steps.parse.outputs.issueparser_reproduction_steps }} CODE_SAMPLE: ${{ steps.parse.outputs.issueparser_code_sample }} WHATSAPP_TYPE: ${{ steps.parse.outputs.issueparser_whatsapp_type }} AUTH_TYPE: ${{ steps.parse.outputs.issueparser_auth_type }} LIB_VERSION: ${{ steps.parse.outputs.issueparser_lib_version }} WWEB_VERSION: ${{ steps.parse.outputs.issueparser_wweb_version }} BROWSER_TYPE: ${{ steps.parse.outputs.issueparser_browser_type }} BROWSER_VERSION: ${{ steps.parse.outputs.issueparser_browser_version }} COMPUTER_OS: ${{ steps.parse.outputs.issueparser_computer_os }} PHONE_OS: ${{ steps.parse.outputs.issueparser_phone_os }} NODE_VERSION: ${{ steps.parse.outputs.issueparser_node_version }} CHECKLIST: ${{ steps.parse.outputs.issueparser_checklist }} run: | { echo 'body<> "$GITHUB_OUTPUT" - name: Update issue body uses: julien-deramond/update-issue-body@v1 with: issue-number: ${{ github.event.issue.number }} body: ${{ steps.summary.outputs.body }} edit-mode: replace - name: Determine priority label id: priority_label env: PRIORITY: ${{ steps.parse.outputs.issueparser_priority }} run: | if [[ "$PRIORITY" == "Low"* ]]; then echo "label=issued low" >> "$GITHUB_OUTPUT" elif [[ "$PRIORITY" == "Medium"* ]]; then echo "label=issued medium" >> "$GITHUB_OUTPUT" elif [[ "$PRIORITY" == "High"* ]]; then echo "label=issued high" >> "$GITHUB_OUTPUT" fi - name: Add priority label if: steps.priority_label.outputs.label != '' uses: actions-ecosystem/action-add-labels@v1 with: labels: ${{ steps.priority_label.outputs.label }}