feat: Add more logs for downloading codex #566
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
| name: pr-message | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| jobs: | |
| validate-pr-message: | |
| name: validate-pr-message | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| steps: | |
| - name: Validate PR title and body | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const title = pr.title || ""; | |
| const body = (pr.body || "") | |
| .replace(/\r\n/g, "\n") | |
| .trim(); | |
| const allowedTypes = [ | |
| "feat", | |
| "fix", | |
| "docs", | |
| "style", | |
| "refactor", | |
| "perf", | |
| "test", | |
| "build", | |
| "ci", | |
| "chore", | |
| "revert", | |
| ]; | |
| // Conventional Commits v1.0.0 title/header with this repo's type allowlist: | |
| // <type>[optional scope][optional !]: <description> | |
| const titleRe = new RegExp( | |
| `^(${allowedTypes.join("|")})(\\([a-z0-9._-]+\\))?!?: \\S.*$`, | |
| "i" | |
| ); | |
| if (!titleRe.test(title)) { | |
| core.setFailed( | |
| [ | |
| "Invalid PR title.", | |
| "", | |
| "Expected Conventional Commit title format:", | |
| " <type>[optional scope][optional !]: <description>", | |
| "", | |
| `Allowed types: ${allowedTypes.join(", ")}`, | |
| "Type matching is case-insensitive.", | |
| "", | |
| "Examples:", | |
| " feat(scope): add agent picker", | |
| " fix(api)!: reject bad token", | |
| " docs: update README", | |
| "", | |
| `Actual: ${title}`, | |
| ].join("\n") | |
| ); | |
| return; | |
| } | |
| if (/^Co-authored-by:\s+/im.test(body)) { | |
| core.setFailed( | |
| 'Invalid PR body: must not contain "Co-authored-by:" trailers.' | |
| ); | |
| return; | |
| } | |
| const conflictMarkerRe = | |
| /^<{7}(?: .*)?$[\s\S]*^={7}$[\s\S]*^>{7}(?: .*)?$/m; | |
| if (conflictMarkerRe.test(body)) { | |
| core.setFailed( | |
| [ | |
| "Invalid PR body.", | |
| "", | |
| "The body appears to contain unresolved merge conflict markers.", | |
| "Please resolve the conflict markers before opening or updating the PR.", | |
| ].join("\n") | |
| ); | |
| return; | |
| } | |
| core.info("PR title and body look good."); |