Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4001fe5
feat: add code-review task (initial commit)
DevelopmentCats Dec 4, 2025
c6b85ec
temp(workflows): update code-review workflow to use shared secrets fo…
DevelopmentCats Dec 4, 2025
2fea873
refactor: enhance code-review workflow with improved GitHub authentic…
DevelopmentCats Dec 4, 2025
84ccad8
chore: enhance code-review workflow with URL validation and improved …
DevelopmentCats Dec 4, 2025
d94e9df
refactor: update code-review workflow to enhance review phases and su…
DevelopmentCats Dec 4, 2025
724e8b1
fix: security vuln in linting
DevelopmentCats Dec 9, 2025
96e6afd
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 9, 2025
647b610
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 10, 2025
c7c96e9
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 10, 2025
c5fe6c5
chore(workflows): add security instructions for PR content review
DevelopmentCats Dec 10, 2025
96c66d6
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 10, 2025
62bf201
chore(workflows): streamline code review process and enhance security…
DevelopmentCats Dec 11, 2025
ca4dd32
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 11, 2025
dcaedbd
chore(workflows): update code review prompt for critical suggestion i…
DevelopmentCats Dec 11, 2025
ff8d037
chore(workflows): enhance code review instructions for suggestion for…
DevelopmentCats Dec 11, 2025
a26b00f
chore(workflows): rewrite prompt
DevelopmentCats Dec 11, 2025
595278f
chore(workflows): update code review guidelines to include Coder-spec…
DevelopmentCats Dec 11, 2025
50dc5c0
chore(workflows): refine code review guidelines to emphasize actionab…
DevelopmentCats Dec 11, 2025
8ab152f
chore(workflows): update code review guidelines to address additional…
DevelopmentCats Dec 11, 2025
3d1dd32
chore(workflows): clarify code review guidelines regarding the use of…
DevelopmentCats Dec 11, 2025
5d9492b
chore: apply code-review suggestion for gnu specific syntax
DevelopmentCats Dec 11, 2025
32e54e8
chore(workflows): update code review comments to include Coder Tasks …
DevelopmentCats Dec 11, 2025
7ba4bdf
chore(workflows): simplify code review process by updating commit SHA…
DevelopmentCats Dec 11, 2025
f0eaa46
chore(workflows): improve portability of PR number extraction by repl…
DevelopmentCats Dec 11, 2025
d6cdd8f
Merge branch 'main' into cat/code-review-task
DevelopmentCats Dec 12, 2025
50281ce
chore(workflows): enhance code review instructions with clearer guide…
DevelopmentCats Dec 12, 2025
fb144d5
chore(workflows): update code review guidelines to enhance clarity an…
DevelopmentCats Dec 12, 2025
9a5f70f
chore(workflows): improve error handling and clarify set -u behavior …
DevelopmentCats Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(workflows): improve error handling and clarify set -u behavior …
…in code review guidelines
  • Loading branch information
DevelopmentCats committed Dec 12, 2025
commit 9a5f70fc49f7fb4fa1fc4af70c7d4de313ac3f9e
18 changes: 17 additions & 1 deletion .github/workflows/code-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ jobs:

# Extract PR number from URL
PR_NUMBER=$(echo "${INPUTS_PR_URL}" | sed -n 's|.*/pull/\([0-9]*\)$|\1|p')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: sed command can fail silently, leaving PR_NUMBER empty if URL doesn't match pattern.

Impact: Empty PR_NUMBER causes cryptic failures in downstream git commands (git fetch, gh api calls) with confusing error messages like "pull//head" or "pull undefined/reviews".

Suggested change
PR_NUMBER=$(echo "${INPUTS_PR_URL}" | sed -n 's|.*/pull/\([0-9]*\)$|\1|p')
PR_NUMBER=$(echo "${INPUTS_PR_URL}" | sed -n 's|.*/pull/\([0-9]*\)$|\1|p')
if [[ -z "${PR_NUMBER}" ]]; then
echo "::error::Failed to extract PR number from URL: ${INPUTS_PR_URL}"
exit 1
fi
echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"

if [[ -z "${PR_NUMBER}" ]]; then
echo "::error::Failed to extract PR number from URL: ${INPUTS_PR_URL}"
exit 1
fi
echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"

elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
Expand Down Expand Up @@ -158,7 +162,19 @@ jobs:
❌ Style that matches existing Coder patterns (check AGENTS.md first)
❌ Code that already exists (read the file first!)
❌ Unnecessary changes unrelated to the PR
❌ Claiming set -u prevents empty strings (it only catches undefined vars)

IMPORTANT - UNDERSTAND set -u:
set -u only catches UNDEFINED/UNSET variables. It does NOT catch empty strings.

Examples:
- unset VAR; echo \${VAR} → ERROR with set -u (undefined)
- VAR=""; echo \${VAR} → OK with set -u (defined, just empty)
- VAR="\${INPUT:-}"; echo \${VAR} → OK with set -u (always defined, may be empty)

GitHub Actions context variables (github.*, inputs.*) are ALWAYS defined.
They may be empty strings, but they are never undefined.

Don't comment on set -u unless you see actual undefined variable access.
</instructions>

<github_api_documentation>
Expand Down
Loading