docs(shared): document UTC-format selection rule in autobot_shared.time_utils (#5169 part A) #1610
Workflow file for this run
This file contains hidden or 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
| # Notify issues referenced in PRs merged to non-default branches | |
| # | |
| # GitHub's built-in auto-close keywords (Closes #NNN, Fixes #NNN) only | |
| # trigger when merging to the default branch (main). Since AutoBot PRs | |
| # target Dev_new_gui, this workflow posts a notification comment on | |
| # referenced issues instead of auto-closing them — preventing premature | |
| # closure of partially-resolved or multi-phase issues. | |
| # | |
| # See: https://github.com/mrveiss/AutoBot-AI/issues/1601 | |
| # Changed to comment-only: https://github.com/mrveiss/AutoBot-AI/issues/1659 | |
| name: Notify referenced issues on merge | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: [Dev_new_gui] | |
| jobs: | |
| notify-issues: | |
| if: github.event.pull_request.merged == true | |
| runs-on: self-hosted | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Notify referenced issues | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const prBody = context.payload.pull_request.body || ''; | |
| const prNumber = context.payload.pull_request.number; | |
| const prTitle = context.payload.pull_request.title; | |
| // Match GitHub auto-close keywords: | |
| // close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved | |
| const pattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+#(\d+)/gi; | |
| const issueNumbers = new Set(); | |
| let match; | |
| while ((match = pattern.exec(prBody)) !== null) { | |
| issueNumbers.add(parseInt(match[1], 10)); | |
| } | |
| if (issueNumbers.size === 0) { | |
| console.log('No issue references found in PR body.'); | |
| return; | |
| } | |
| console.log(`Found issue references: ${[...issueNumbers].join(', ')}`); | |
| for (const issueNumber of issueNumbers) { | |
| try { | |
| const issue = await github.rest.issues.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| }); | |
| if (issue.data.state === 'closed') { | |
| console.log(`Issue #${issueNumber} is already closed — skipping.`); | |
| continue; | |
| } | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| body: [ | |
| `PR #${prNumber} (merged to \`Dev_new_gui\`) references this issue with a close keyword.`, | |
| '', | |
| `> **${prTitle}**`, | |
| '', | |
| 'If this issue is fully resolved, close it manually. If work remains, no action is needed.', | |
| ].join('\n'), | |
| }); | |
| console.log(`Commented on issue #${issueNumber} (not auto-closed).`); | |
| } catch (error) { | |
| console.log(`Failed to comment on issue #${issueNumber}: ${error.message}`); | |
| } | |
| } |