Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
21 changes: 20 additions & 1 deletion .claude/settings/permissions/bash.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,17 @@
"Bash(tail *)",
// Search
"Bash(rg *)",
// Research
"Bash(gh issue list *)",
"Bash(gh pr view *)",
"Bash(gh pr diff *)"
],
"ask": [
"Bash(gh *)", // let's hold off before we let it use the github CLI in any free running allow mode...I don't want it somehow approving PRs with the user's credentials
// let's hold off before we let it use the github CLI in any free running allow mode...I don't want it somehow approving PRs with the user's credentials
"Bash(gh repo *)",
"Bash(gh release *)",
"Bash(gh secret *)",
"Bash(gh ruleset *)",
"Bash(aws *)", // let's hold off before we let it use AWS CLI in any free running allow mode. We need to be very sure we don't have any access to staging or production credentials in our dev environment (...which we shouldn't...but we need to double check that or consider any other safeguards first)
"Bash(curl *)",
"Bash(ln *)",
Expand All @@ -85,6 +93,17 @@
"deny": [
// Exceptions to generally allowed AI tooling
"Bash(bd init*)", // we need to control the init process, don't let AI do that in the background
// Github
// Claude should not ever interfere with the PR process, that is how we gate AI's work
"Bash(gh pr create *)",
"Bash(gh pr edit *)",
"Bash(gh pr ready *)",
"Bash(gh pr review *)",
"Bash(gh pr merge *)",
"Bash(gh pr close *)",
"Bash(gh pr comment *)",
"Bash(gh pr update-branch *)",
Comment on lines +96 to +105
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Good deny list for PR mutations, consider adding gh pr reopen.

Comprehensive blocking of PR workflow commands. Consider also adding gh pr reopen * to the deny list to prevent reopening closed PRs.

Proposed addition
       "Bash(gh pr comment *)",
       "Bash(gh pr update-branch *)",
+      "Bash(gh pr reopen *)",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/settings/permissions/bash.jsonc around lines 96 - 105, The deny list
for PR mutation commands is missing the reopen command; add an entry like
"Bash(gh pr reopen *)" to the permissions array alongside the existing "Bash(gh
pr create *)", "Bash(gh pr edit *)", "Bash(gh pr merge *)", etc., so Claude
cannot reopen closed PRs; update the .claude/settings/permissions/bash.jsonc
list to include the new "Bash(gh pr reopen *)" deny pattern.


// Destructive File Operations
"Bash(chmod -R *)",
"Bash(chown -R *)",
Expand Down
2 changes: 2 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ reviews:
instructions: "These files came from a vendor and we're not allowed to change them. Refer to it if you need to understand how the main code interacts with it, but do not make comments about it."
- path: "**/*.py"
instructions: "Check the `ruff.toml` and `ruff-test.toml` for linting rules we've explicitly disabled and don't suggest changes to please conventions we've disabled. Do not express concerns about ruff rules; a pre-commit hook already runs a ruff check. Do not warn about unnecessary super().__init__() calls; pyright prefers those to be present. Do not warn about missing type hints; a pre-commit hook already checks for that."
- path: "**/.copier-answers.yml"
instructions: "Do not comment about the `_commit` value needing to be a clean release tag. A CI job will fail if that is not the case."
tools:
eslint: # when the code contains typescript, eslint will be run by pre-commit, and coderabbit often generates false positives
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.61
_commit: v0.0.63
_src_path: gh:LabAutomationAndScreening/copier-python-package-template
configure_python_asyncio: false
configure_vcrpy: false
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# base image tags available at https://mcr.microsoft.com/v2/devcontainers/universal/tags/list
# added the platform flag to override any local settings since this image is only compatible with linux/amd64. since this image is only x64 compatible, suppressing the hadolint rule
# hadolint ignore=DL3029
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/universal:5.1.4-noble
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/universal:5.1.5-noble

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
18 changes: 11 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"hostRequirements": {
"cpus": 2,
"memory": "4gb"
},
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
Expand Down Expand Up @@ -34,21 +38,21 @@
"ms-vscode.live-server@0.5.2025051301",
"MS-vsliveshare.vsliveshare@1.0.5905",
"github.copilot@1.388.0",
"github.copilot-chat@0.38.2026022704",
"anthropic.claude-code@2.1.74",
"github.copilot-chat@0.42.2026032602",
"anthropic.claude-code@2.1.84",

// Python
"ms-python.python@2026.2.2026021801",
"ms-python.vscode-pylance@2026.1.1",
"ms-python.python@2026.5.2026032701",
"ms-python.vscode-pylance@2026.1.102",
"ms-vscode-remote.remote-containers@0.414.0",
"charliermarsh.ruff@2026.36.0",
"charliermarsh.ruff@2026.38.0",

// Misc file formats
"bierner.markdown-mermaid@1.29.0",
"samuelcolvin.jinjahtml@0.20.0",
"tamasfe.even-better-toml@0.19.2",
"emilast.LogFileHighlighter@3.3.3",
"esbenp.prettier-vscode@12.3.0"
"esbenp.prettier-vscode@12.4.0"
],
Comment on lines +41 to 56
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Extension version updates look good.

Note: Line 69 (unchanged) still contains a hardcoded path /workspaces/ephemeral-pulumi-deploy/ruff-test.toml. If the PR goal is to remove hardcoded paths for portability, this should also be addressed. The TODO comment on line 68 acknowledges this limitation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json around lines 41 - 56, Replace the hardcoded
path "/workspaces/ephemeral-pulumi-deploy/ruff-test.toml" referenced next to the
TODO comment by making it configurable and portable: either change the
devcontainer.json entry to use a workspace-relative path (e.g., reference the
file name only or use ${workspaceFolder}) or read the path from an environment
variable and document that in the TODO; update any references where that exact
string appears so the devcontainer no longer assumes
/workspaces/ephemeral-pulumi-deploy.

"settings": {
"editor.accessibilitySupport": "off", // turn off sounds
Expand All @@ -73,5 +77,5 @@
"initializeCommand": "sh .devcontainer/initialize-command.sh",
"onCreateCommand": "sh .devcontainer/on-create-command.sh",
"postStartCommand": "sh .devcontainer/post-start-command.sh"
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 7dfa8182 # spellchecker:disable-line
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): b046471b # spellchecker:disable-line
}
4 changes: 2 additions & 2 deletions .devcontainer/install-ci-tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import tempfile
from pathlib import Path

UV_VERSION = "0.10.10"
PNPM_VERSION = "10.32.1"
UV_VERSION = "0.10.12"
PNPM_VERSION = "10.33.0"
COPIER_VERSION = "==9.14.0"
COPIER_TEMPLATE_EXTENSIONS_VERSION = "==0.3.3"
PRE_COMMIT_VERSION = "4.5.1"
Expand Down
17 changes: 17 additions & 0 deletions .devcontainer/manual-setup-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
default=False,
help="Allow uv to install new versions of Python on the fly. This is typically only needed when instantiating the copier template.",
)
_ = parser.add_argument(
"--skip-installing-pulumi-cli",
action="store_true",
default=False,
help="Do not install the Pulumi CLI even if the lock file references it",
)


class PackageManager(str, enum.Enum):
Expand Down Expand Up @@ -127,6 +133,17 @@ def main():
check=True,
env=uv_env,
)
if (
not generate_lock_file_only
and not args.skip_installing_pulumi_cli
and platform.system() == "Linux"
and env.lock_file.exists()
and '"pulumi"' in env.lock_file.read_text()
):
_ = subprocess.run(
["sh", str(REPO_ROOT_DIR / ".devcontainer" / "install-pulumi-cli.sh"), str(env.lock_file)],
check=True,
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
elif env.package_manager == PackageManager.PNPM:
pnpm_command = ["pnpm", "install", "--dir", str(env.path)]
if env_check_lock:
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/on-create-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ set -ex

# For some reason the directory is not setup correctly and causes build of devcontainer to fail since
# it doesn't have access to the workspace directory. This can normally be done in post-start-command
git config --global --add safe.directory /workspaces/ephemeral-pulumi-deploy
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
repo_root="$(CDPATH= cd -- "$script_dir/.." && pwd)"
git config --global --add safe.directory "$repo_root"
Comment on lines +6 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for remaining hardcoded workspace paths in devcontainer config
rg -n "ephemeral-pulumi-deploy" .devcontainer/

Repository: LabAutomationAndScreening/ephemeral-pulumi-deploy

Length of output: 692


Good refactor to dynamic path resolution.

The CDPATH= cd pattern is intentional (clears CDPATH to ensure predictable cd behavior) — the Shellcheck SC1007 warning is a false positive for this idiom.

However, the dynamic path resolution is incomplete. The devcontainer config still contains hardcoded /workspaces/ephemeral-pulumi-deploy paths in:

  • docker-compose.yml: volume mounts (lines 11, 13) and BEADS_DIR env var (line 21)
  • devcontainer.json: ruff.configuration path (line 69)

For full portability, consider parameterizing these references using environment variables or shell variable substitution.

🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 6-6: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)


[warning] 7-7: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/on-create-command.sh around lines 6 - 8, The devcontainer uses
dynamic path resolution via the script variables script_dir and repo_root but
docker-compose.yml and devcontainer.json still contain hardcoded
/workspaces/ephemeral-pulumi-deploy paths; update those references so they use
an environment variable (e.g., export REPO_ROOT or BEADS_DIR from the on-create
script or an .env file) and then substitute that variable into docker-compose
volume mounts and the BEADS_DIR env var and into devcontainer.json's
ruff.configuration path (search for BEADS_DIR, ruff.configuration, and the
hardcoded /workspaces/ephemeral-pulumi-deploy strings) so the container config
becomes portable across workspace names.


sh .devcontainer/on-create-command-boilerplate.sh
# install json5 for merging claude settings. TODO: consider if we can install json5 globally...or somehow eliminate this dependency
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
repo_root="$(CDPATH= cd -- "$script_dir/.." && pwd)"
mkdir -p "$repo_root/.claude"
chmod -R ug+rwX "$repo_root/.claude"
chgrp -R 0 "$repo_root/.claude" || true
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/post-start-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ set -ex

# For some reason the directory is not setup correctly and causes build of devcontainer to fail since
# it doesn't have access to the workspace directory. This can normally be done in post-start-command
git config --global --add safe.directory /workspaces/ephemeral-pulumi-deploy
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
repo_root="$(CDPATH= cd -- "$script_dir/.." && pwd)"
git config --global --add safe.directory "$repo_root"
pre-commit run merge-claude-settings -a
if ! bd ready; then
echo "It's likely the Dolt server has not yet been initialized to support beads, running that now" # TODO: figure out a better way to match this specific scenario than just a non-zero exit code...but beads still seems like in high flux right now so not sure what to tie it to
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/install_deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ inputs:
description: Whether to skip updating the hash when running manual-setup-deps.py
default: true
required: false
skip-installing-pulumi-cli:
type: boolean
description: Whether to skip installing the Pulumi CLI even if the lock file references it
default: false
required: false


runs:
Expand Down Expand Up @@ -83,5 +88,5 @@ runs:
- name: Install dependencies
# the funky syntax is github action ternary
if: ${{ inputs.install-deps }}
run: python .devcontainer/manual-setup-deps.py ${{ inputs.python-version == 'notUsing' && '--no-python' || '' }} ${{ inputs.node-version == 'notUsing' && '--no-node' || '' }} ${{ inputs.skip-updating-devcontainer-hash && '--skip-updating-devcontainer-hash' || '' }}
run: python .devcontainer/manual-setup-deps.py ${{ inputs.python-version == 'notUsing' && '--no-python' || '' }} ${{ inputs.node-version == 'notUsing' && '--no-node' || '' }} ${{ inputs.skip-updating-devcontainer-hash && '--skip-updating-devcontainer-hash' || '' }} ${{ inputs.skip-installing-pulumi-cli && '--skip-installing-pulumi-cli' || '' }}
shell: pwsh
56 changes: 49 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches-ignore:
- 'gh-readonly-queue/**' # don't run (again) when on these special branches created during merge groups; the `on: merge_group` already triggers it.
merge_group:
pull_request:

env:
PYTHONUNBUFFERED: True
Expand All @@ -18,11 +19,32 @@ jobs:
get-values:
uses: ./.github/workflows/get-values.yaml
permissions:
contents: write # needed updating dependabot branches
contents: write # needed for updating dependabot branches

check-skip-duplicate:
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: read # needed to check if PR exists for current branch
outputs:
should-run: ${{ steps.check.outputs.should-run }}
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
with:
persist-credentials: false
- id: check
uses: ./.github/actions/check-skip-duplicates

confirm-on-tagged-copier-template:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
uses: ./.github/workflows/confirm-on-tagged-copier-template.yaml

lint:
needs:
- get-values
- check-skip-duplicate
if: needs.check-skip-duplicate.outputs.should-run == 'true'
name: Pre-commit
uses: ./.github/workflows/pre-commit.yaml
permissions:
Expand All @@ -34,6 +56,8 @@ jobs:
test:
needs:
- lint
- check-skip-duplicate
if: needs.check-skip-duplicate.outputs.should-run == 'true'
strategy:
matrix:
os:
Expand Down Expand Up @@ -63,6 +87,8 @@ jobs:
- name: Install python tooling
uses: ./.github/actions/install_deps
with:
skip-installing-ssm-plugin-manager: true
skip-installing-pulumi-cli: true
python-version: ${{ matrix.python-version }}

- name: Unit test
Expand All @@ -86,29 +112,45 @@ jobs:



required-check:
workflow-summary:
runs-on: ubuntu-24.04
permissions:
statuses: write # needed for updating status on Dependabot PRs
timeout-minutes: 2
needs:
- get-values
- check-skip-duplicate
- lint
- test
- confirm-on-tagged-copier-template
permissions:
statuses: write # needed for updating status on Dependabot PRs
if: always()
timeout-minutes: 2
steps:
- name: fail if prior job failure
run: |
success_pattern="^(skipped|success)$" # these are the possibilities: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#needs-context

if [[ ! "${{ needs.get-values.result }}" =~ $success_pattern ]] ||
[[ ! "${{ needs.check-skip-duplicate.result }}" =~ $success_pattern ]] ||
[[ ! "${{ needs.lint.result }}" =~ $success_pattern ]] ||
[[ ! "${{ needs.test.result }}" =~ $success_pattern ]]; then
[[ ! "${{ needs.test.result }}" =~ $success_pattern ]] ||
[[ ! "${{ needs.confirm-on-tagged-copier-template.result }}" =~ $success_pattern ]]; then
echo "❌ One or more jobs did not finish with skipped or success"
exit 1
fi
echo "✅ All jobs finished with skipped or success"
- name: Mark updated Dependabot commit of devcontainer hash as succeeded

- name: Mark the required-check as succeeded so the PR can be merged
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
-X POST -H "Accept: application/vnd.github.v3+json" \
"${{ github.event.pull_request.statuses_url }}" \
-f state=success -f context="required-check" -f description="✅ All required checks passed in the job triggered by pull_request" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Comment on lines +143 to +152
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cd .github/workflows && head -160 ci.yaml | tail -25

Repository: LabAutomationAndScreening/ephemeral-pulumi-deploy

Length of output: 1400


🌐 Web query:

GitHub Actions merge_group event payload structure statuses_url

💡 Result:

The GitHub Actions merge_group event payload structure, particularly regarding statuses_url, is as follows based on available evidence: The top-level payload includes: - action: string (e.g., "checks_requested") - merge_group: object containing: - base_ref: string (e.g., "refs/heads/main") - base_sha: string - head_commit: object with author, committer, id, message, timestamp, tree_id - head_ref: string (e.g., "refs/heads/gh-readonly-queue/main/pr-123-abc123def456") - head_sha: string (the commit SHA for status checks) - organization: object - repository: standard GitHub repository object The statuses_url is not present at the top level or directly in merge_group. However, since repository follows the standard GitHub repository schema (as seen in common webhook payloads and schemas), it includes statuses_url: "https://api.github.com/repos/{owner}/{repo}/statuses/{sha}", where {sha} is typically the head commit SHA. Status checks for merge groups are reported against the merge_group.head_sha using this URL, as confirmed by GitHub documentation on merge queues requiring status checks on the merge group head commit. Official GitHub Docs do not provide a complete merge_group payload example, but schemas from octokit/webhooks and API examples confirm the repository object inclusion with standard fields like statuses_url. Sample payloads from third-party sources (e.g., MagicBell) show the repository object with expected fields like html_url, implying standard properties including statuses_url. Confidence is high for the structure from multiple confirming sources, medium for exact statuses_url presence due to reliance on standard repository schema rather than a direct merge_group example.

Citations:


Split status API calls by event type to support merge-queue runs.

The step at lines 142–151 runs on both pull_request and merge_group events but posts status only to github.event.pull_request.statuses_url. The merge_group event payload does not contain pull_request context—its status must be reported to /repos/{owner}/{repo}/statuses/{merge_group_head_sha} instead. On merge-group triggers, the current code will fail this step, blocking the merge queue.

Split into two separate steps: one for pull_request using github.event.pull_request.statuses_url, and one for merge_group using /repos/${{ github.repository }}/statuses/${{ github.sha }}.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 142 - 151, The step "Mark the
required-check as succeeded so the PR can be merged" currently posts only to
github.event.pull_request.statuses_url and fails for merge_group runs; split
this into two steps conditioned by event type: one step with if:
github.event_name == 'pull_request' that posts to ${{
github.event.pull_request.statuses_url }}, and a second step with if:
github.event_name == 'merge_group' that POSTs to /repos/${{ github.repository
}}/statuses/${{ github.sha }} (keeping the same GH_TOKEN env and payload fields
state/context/description/target_url) so merge-queue runs report status to the
merge_group head SHA.


- name: Mark updated dependabot hash commit as succeeded
if: needs.get-values.outputs.dependabot-commit-created == 'true'
env:
GH_TOKEN: ${{ github.token }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/confirm-on-tagged-copier-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Confirm using tagged copier template version

on:
workflow_call:
inputs:
answers_file:
description: 'Path to the copier answers file'
type: string
default: '.copier-answers.yml'

jobs:
confirm-on-tagged-copier-template:
runs-on: ubuntu-24.04
timeout-minutes: 2
name: Fail if template under development
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
with:
persist-credentials: false

- name: Check _commit is a clean release tag
run: |
ANSWERS_FILE="${{ inputs.answers_file }}"
if [ ! -f "$ANSWERS_FILE" ]; then
echo "Error: $ANSWERS_FILE not found"
exit 1
fi
COMMIT_LINE=$(grep "^_commit:" "$ANSWERS_FILE")
if echo "$COMMIT_LINE" | grep -q "-"; then
echo "Error: $COMMIT_LINE"
echo "_commit must be a clean release tag (e.g. v0.0.111), not a dev commit (e.g. v0.0.106-14-g7847d7b)"
exit 1
Comment on lines +29 to +33
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

check() {
  local label="$1"
  local content="$2"
  COMMIT_LINE=$(printf '%s\n' "$content" | grep '^_commit:' || true)

  if echo "$COMMIT_LINE" | grep -q '-'; then
    result=fail
  else
    result=pass
  fi

  printf '%-15s -> %s | %q\n' "$label" "$result" "$COMMIT_LINE"
}

check missing 'foo: bar'
check nonsensical '_commit: main'
check inline_comment '_commit: v0.0.111 # stable-release'

Repository: LabAutomationAndScreening/ephemeral-pulumi-deploy

Length of output: 226


Parse and validate the _commit value against the semantic version format.

The current validation checks whether the raw line contains -, which creates three issues:

  • Missing _commit passes the check (empty line has no hyphen)
  • Invalid values like _commit: main pass
  • Valid tags with inline comments like _commit: v0.0.111 # stable-release fail

Extract the value portion, strip comments and whitespace, then validate it matches v[0-9]+\.[0-9]+\.[0-9]+ format.

Proposed fix
       - name: Check _commit is a clean release tag
         run: |
           ANSWERS_FILE="${{ inputs.answers_file }}"
           if [ ! -f "$ANSWERS_FILE" ]; then
             echo "Error: $ANSWERS_FILE not found"
             exit 1
           fi
-          COMMIT_LINE=$(grep "^_commit:" "$ANSWERS_FILE")
-          if echo "$COMMIT_LINE" | grep -q "-"; then
-            echo "Error: $COMMIT_LINE"
+          COMMIT_VALUE=$(grep -m1 "^_commit:" "$ANSWERS_FILE" | cut -d: -f2- | cut -d# -f1 | xargs)
+          if [ -z "$COMMIT_VALUE" ]; then
+            echo "Error: _commit not found in $ANSWERS_FILE"
+            exit 1
+          fi
+          if ! echo "$COMMIT_VALUE" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
+            echo "Error: _commit=$COMMIT_VALUE"
             echo "_commit must be a clean release tag (e.g. v0.0.111), not a dev commit (e.g. v0.0.106-14-g7847d7b)"
             exit 1
           fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COMMIT_LINE=$(grep "^_commit:" "$ANSWERS_FILE")
if echo "$COMMIT_LINE" | grep -q "-"; then
echo "Error: $COMMIT_LINE"
echo "_commit must be a clean release tag (e.g. v0.0.111), not a dev commit (e.g. v0.0.106-14-g7847d7b)"
exit 1
COMMIT_VALUE=$(grep -m1 "^_commit:" "$ANSWERS_FILE" | cut -d: -f2- | cut -d# -f1 | xargs)
if [ -z "$COMMIT_VALUE" ]; then
echo "Error: _commit not found in $ANSWERS_FILE"
exit 1
fi
if ! echo "$COMMIT_VALUE" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: _commit=$COMMIT_VALUE"
echo "_commit must be a clean release tag (e.g. v0.0.111), not a dev commit (e.g. v0.0.106-14-g7847d7b)"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/confirm-on-tagged-copier-template.yaml around lines 29 -
33, The current COMMIT_LINE check is brittle; instead extract the value after
the ":" from COMMIT_LINE, strip any inline comments (text after "#") and
surrounding whitespace, ensure the resulting commit_value is non-empty, then
validate it against the regex ^v[0-9]+\.[0-9]+\.[0-9]+$; replace the simple
hyphen check with this logic in the block that sets COMMIT_LINE (reading from
ANSWERS_FILE) and on failure echo a clear error message and exit 1.

fi
1 change: 1 addition & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
python-version: ${{ inputs.python-version }}
node-version: ${{ inputs.node-version }}
skip-installing-ssm-plugin-manager: true
skip-installing-pulumi-cli: true

- name: Set up mutex # Github concurrency management is horrible, things get arbitrarily cancelled if queued up. So using mutex until github fixes itself. When multiple jobs are modifying cache at once, weird things can happen. possible issue is https://github.com/actions/toolkit/issues/658
if: ${{ runner.os != 'Windows' }} # we're just gonna have to YOLO on Windows, because this action doesn't support it yet https://github.com/ben-z/gh-action-mutex/issues/14
Expand Down
Loading