From 6ee87611733d955763c7495b0516a04e5463bd4e Mon Sep 17 00:00:00 2001 From: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Date: Tue, 9 Jun 2026 21:50:24 +0000 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20implement=20issue=20#207=20?= =?UTF-8?q?=E2=80=94=20[Fleet=20Monitor]=20petry-projects/TalkTerm=20?= =?UTF-8?q?=E2=80=94=20copilot-setup-steps.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/copilot-setup-steps.yml | 2 +- scripts/test-copilot-setup-steps-workflow.sh | 45 ++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 scripts/test-copilot-setup-steps-workflow.sh diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 05e37031..bb319fdd 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -79,7 +79,7 @@ jobs: - name: Install Node.js dependencies # npm ci requires a package-lock.json — skip gracefully until one is committed. if: hashFiles('package-lock.json') != '' - run: npm ci + run: npm ci --ignore-scripts - name: Verify environment run: | diff --git a/scripts/test-copilot-setup-steps-workflow.sh b/scripts/test-copilot-setup-steps-workflow.sh new file mode 100644 index 00000000..ea098a47 --- /dev/null +++ b/scripts/test-copilot-setup-steps-workflow.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Regression guard: assert that copilot-setup-steps.yml contains the required +# `npm ci --ignore-scripts` invocation (aligned with the org canonical template). +# +# Run: bash scripts/test-copilot-setup-steps-workflow.sh +set -euo pipefail + +WORKFLOW=".github/workflows/copilot-setup-steps.yml" +PASS=true + +echo "=== test-copilot-setup-steps-workflow ===" + +# ── Check 1: file exists ─────────────────────────────────────────────────── +if [[ ! -f "$WORKFLOW" ]]; then + echo "FAIL: $WORKFLOW not found" + exit 1 +fi +echo "PASS: $WORKFLOW exists" + +# ── Check 2: npm ci uses --ignore-scripts ───────────────────────────────── +if grep -qE 'npm ci\b' "$WORKFLOW" && ! grep -qE 'npm ci\s+--ignore-scripts' "$WORKFLOW"; then + echo "FAIL: 'npm ci' found without '--ignore-scripts' in $WORKFLOW" + echo " Update the step to: run: npm ci --ignore-scripts" + PASS=false +elif grep -qE 'npm ci\s+--ignore-scripts' "$WORKFLOW"; then + echo "PASS: 'npm ci --ignore-scripts' present in $WORKFLOW" +else + echo "INFO: no 'npm ci' call found (step may be absent — OK if no package-lock.json guard)" +fi + +# ── Check 3: install step has the hashFiles guard ───────────────────────── +if ! grep -q "hashFiles('package-lock.json')" "$WORKFLOW"; then + echo "FAIL: hashFiles guard missing from $WORKFLOW — 'npm ci' must be conditional" + PASS=false +else + echo "PASS: hashFiles guard present in $WORKFLOW" +fi + +echo "" +if [[ "$PASS" == "true" ]]; then + echo "All checks passed." +else + echo "One or more checks failed." + exit 1 +fi From 6ffc25d5d8e1ae5dc061602be128d2af7bfc5ac3 Mon Sep 17 00:00:00 2001 From: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Date: Tue, 9 Jun 2026 21:53:25 +0000 Subject: [PATCH 2/2] fix(bot): address bot feedback [skip ci-relay] --- scripts/test-copilot-setup-steps-workflow.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/test-copilot-setup-steps-workflow.sh b/scripts/test-copilot-setup-steps-workflow.sh index ea098a47..690ff633 100644 --- a/scripts/test-copilot-setup-steps-workflow.sh +++ b/scripts/test-copilot-setup-steps-workflow.sh @@ -18,18 +18,18 @@ fi echo "PASS: $WORKFLOW exists" # ── Check 2: npm ci uses --ignore-scripts ───────────────────────────────── -if grep -qE 'npm ci\b' "$WORKFLOW" && ! grep -qE 'npm ci\s+--ignore-scripts' "$WORKFLOW"; then +if grep -qE 'npm ci([[:space:]]|$)' "$WORKFLOW" && ! grep -qE 'npm ci.*--ignore-scripts' "$WORKFLOW"; then echo "FAIL: 'npm ci' found without '--ignore-scripts' in $WORKFLOW" echo " Update the step to: run: npm ci --ignore-scripts" PASS=false -elif grep -qE 'npm ci\s+--ignore-scripts' "$WORKFLOW"; then +elif grep -qE 'npm ci.*--ignore-scripts' "$WORKFLOW"; then echo "PASS: 'npm ci --ignore-scripts' present in $WORKFLOW" else echo "INFO: no 'npm ci' call found (step may be absent — OK if no package-lock.json guard)" fi # ── Check 3: install step has the hashFiles guard ───────────────────────── -if ! grep -q "hashFiles('package-lock.json')" "$WORKFLOW"; then +if ! grep -qE "hashFiles\([[:space:]]*['\"]package-lock\.json['\"][[:space:]]*\)" "$WORKFLOW"; then echo "FAIL: hashFiles guard missing from $WORKFLOW — 'npm ci' must be conditional" PASS=false else