Skip to content

Commit 4e2b2fd

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/minor-and-patch-updates-c494b0f1a8
2 parents ce1b18b + a6a8c95 commit 4e2b2fd

18 files changed

+291
-305
lines changed

.github/workflows/actionlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden the runner (Audit all outbound calls)
20-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
20+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2121
with:
2222
egress-policy: audit
2323

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Harden the runner (Audit all outbound calls)
23-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
23+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2424
with:
2525
egress-policy: audit
2626

.github/workflows/check-models.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Harden the runner (Audit all outbound calls)
29-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
29+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3030
with:
3131
egress-policy: audit
3232

@@ -99,7 +99,7 @@ jobs:
9999
echo ""
100100
echo "=== Copilot CLI Output ==="
101101
102-
cd ${GITHUB_WORKSPACE}
102+
cd "${GITHUB_WORKSPACE}"
103103
104104
# Run copilot with the prompt using non-interactive mode
105105
COPILOT_PROMPT_TEXT=$(cat /tmp/copilot-prompt.md)
@@ -113,29 +113,29 @@ jobs:
113113
run: |
114114
if git diff --quiet src/tokenEstimators.json src/modelPricing.json; then
115115
echo "No changes detected in model data files"
116-
echo "changed=false" >> $GITHUB_OUTPUT
116+
echo "changed=false" >> "$GITHUB_OUTPUT"
117117
else
118118
# Check if the only change is the lastUpdated date in modelPricing.json
119119
DIFF_OUTPUT=$(git diff src/modelPricing.json)
120120
121121
# Count the number of changed lines (lines starting with +/- but not +++ or ---)
122-
CHANGED_LINES=$(echo "$DIFF_OUTPUT" | grep -E '^[+-][^+-]' | wc -l)
122+
CHANGED_LINES=$(echo "$DIFF_OUTPUT" | grep -cE '^[+-][^+-]' || true)
123123
124124
# Check if only 2 lines changed (one deletion, one addition) and both contain "lastUpdated"
125125
if [ "$CHANGED_LINES" -eq 2 ]; then
126126
# Check if all changed lines contain "lastUpdated"
127-
if echo "$DIFF_OUTPUT" | grep -E '^[+-][^+-]' | grep -v '"lastUpdated"' | wc -l | grep -q '^0$'; then
127+
if ! echo "$DIFF_OUTPUT" | grep -E '^[+-][^+-]' | grep -qv '"lastUpdated"'; then
128128
# Verify no changes to tokenEstimators.json
129129
if git diff --quiet src/tokenEstimators.json; then
130130
echo "Only lastUpdated date changed - skipping PR creation"
131-
echo "changed=false" >> $GITHUB_OUTPUT
131+
echo "changed=false" >> "$GITHUB_OUTPUT"
132132
exit 0
133133
fi
134134
fi
135135
fi
136136
137137
echo "Changes detected in model data files"
138-
echo "changed=true" >> $GITHUB_OUTPUT
138+
echo "changed=true" >> "$GITHUB_OUTPUT"
139139
fi
140140
141141
- name: Create Pull Request

.github/workflows/check-toolnames.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
contents: read
1919
steps:
2020
- name: Harden the runner (Audit all outbound calls)
21-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
21+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2222
with:
2323
egress-policy: audit
2424

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Harden the runner (Audit all outbound calls)
23-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
23+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2424
with:
2525
egress-policy: audit
2626

@@ -81,7 +81,7 @@ jobs:
8181

8282
steps:
8383
- name: Harden the runner (Audit all outbound calls)
84-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
84+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
8585
with:
8686
egress-policy: audit
8787

.github/workflows/cli-build.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,58 @@ on:
1717
- 'src/toolNames.json'
1818
pull_request:
1919
branches: [main]
20-
paths:
21-
- 'cli/**'
22-
- 'src/sessionDiscovery.ts'
23-
- 'src/sessionParser.ts'
24-
- 'src/tokenEstimation.ts'
25-
- 'src/maturityScoring.ts'
26-
- 'src/usageAnalysis.ts'
27-
- 'src/opencode.ts'
28-
- 'src/types.ts'
29-
- 'src/tokenEstimators.json'
30-
- 'src/modelPricing.json'
31-
- 'src/toolNames.json'
3220

3321
permissions:
3422
contents: read
3523

3624
jobs:
25+
check-changes:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
cli-relevant: ${{ github.event_name == 'push' || steps.filter.outputs.cli-relevant == 'true' }}
29+
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
32+
with:
33+
egress-policy: audit
34+
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
37+
- name: Check for CLI-relevant file changes
38+
if: github.event_name == 'pull_request'
39+
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
40+
id: filter
41+
with:
42+
filters: |
43+
cli-relevant:
44+
- 'cli/**'
45+
- 'src/sessionDiscovery.ts'
46+
- 'src/sessionParser.ts'
47+
- 'src/tokenEstimation.ts'
48+
- 'src/maturityScoring.ts'
49+
- 'src/usageAnalysis.ts'
50+
- 'src/opencode.ts'
51+
- 'src/types.ts'
52+
- 'src/tokenEstimators.json'
53+
- 'src/modelPricing.json'
54+
- 'src/toolNames.json'
55+
3756
build-and-validate:
57+
needs: check-changes
58+
if: needs.check-changes.outputs.cli-relevant == 'true'
3859
runs-on: ubuntu-latest
3960
env:
4061
node-version: 22
4162
steps:
4263
- name: Harden Runner
43-
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
64+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
4465
with:
4566
egress-policy: audit
4667

4768
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4869

4970
- name: Setup Node.js ${{ env.node-version }}
50-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
71+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
5172
with:
5273
node-version: ${{ env.node-version }}
5374

.github/workflows/cli-publish.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: cli
4141
steps:
4242
- name: Harden Runner
43-
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
43+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
4444
with:
4545
egress-policy: audit
4646

@@ -72,16 +72,30 @@ jobs:
7272
id: version
7373
run: echo "version=$(node -p 'require("./package.json").version')" >> "$GITHUB_OUTPUT"
7474

75+
- name: Check if version is already published
76+
id: check_published
77+
run: |
78+
PACKAGE_NAME=$(node -p 'require("./package.json").name')
79+
VERSION="${{ steps.version.outputs.version }}"
80+
echo "Checking npm registry for ${PACKAGE_NAME}@${VERSION}..."
81+
if npm view "${PACKAGE_NAME}@${VERSION}" version 2>&1; then
82+
echo "Version ${VERSION} is already published to npm. Skipping publish."
83+
echo "already_published=true" >> "$GITHUB_OUTPUT"
84+
else
85+
echo "Version ${VERSION} is not yet published. Proceeding with publish."
86+
echo "already_published=false" >> "$GITHUB_OUTPUT"
87+
fi
88+
7589
- name: Publish to npm
76-
if: ${{ !inputs.dry_run }}
90+
if: ${{ !inputs.dry_run && steps.check_published.outputs.already_published != 'true' }}
7791
run: NODE_AUTH_TOKEN="" npm publish
7892

7993
- name: Dry run publish
8094
if: ${{ inputs.dry_run }}
8195
run: NODE_AUTH_TOKEN="" npm publish public --dry-run
8296

8397
- name: Commit version bump and create PR
84-
if: ${{ !inputs.dry_run }}
98+
if: ${{ !inputs.dry_run && steps.check_published.outputs.already_published != 'true' }}
8599
run: |
86100
cd ..
87101
git config user.name "github-actions[bot]"
@@ -100,14 +114,22 @@ jobs:
100114

101115
- name: Summary
102116
run: |
103-
echo "## CLI Package Published 📦" >> "$GITHUB_STEP_SUMMARY"
104-
echo "" >> "$GITHUB_STEP_SUMMARY"
105-
echo "- **Version:** v${{ steps.version.outputs.version }}" >> "$GITHUB_STEP_SUMMARY"
106-
echo "- **Bump:** ${{ inputs.version_bump }}" >> "$GITHUB_STEP_SUMMARY"
107-
echo "- **Dry run:** ${{ inputs.dry_run }}" >> "$GITHUB_STEP_SUMMARY"
108-
echo "" >> "$GITHUB_STEP_SUMMARY"
109-
if [ "${{ inputs.dry_run }}" = "false" ]; then
110-
echo "Install with: \`npx @rajbos/ai-engineering-fluency\`" >> "$GITHUB_STEP_SUMMARY"
111-
echo "" >> "$GITHUB_STEP_SUMMARY"
112-
echo "A PR has been opened to merge the version bump back to main." >> "$GITHUB_STEP_SUMMARY"
113-
fi
117+
{
118+
if [ "${{ steps.check_published.outputs.already_published }}" = "true" ]; then
119+
echo "## CLI Package Publish Skipped ⏭️"
120+
echo ""
121+
echo "Version **v${{ steps.version.outputs.version }}** is already published to npm."
122+
else
123+
echo "## CLI Package Published 📦"
124+
echo ""
125+
echo "- **Version:** v${{ steps.version.outputs.version }}"
126+
echo "- **Bump:** ${{ inputs.version_bump }}"
127+
echo "- **Dry run:** ${{ inputs.dry_run }}"
128+
echo ""
129+
if [ "${{ inputs.dry_run }}" = "false" ]; then
130+
echo "Install with: \`npx @rajbos/ai-engineering-fluency\`"
131+
echo ""
132+
echo "A PR has been opened to merge the version bump back to main."
133+
fi
134+
fi
135+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
steps:
4343
- name: Harden the runner (Audit all outbound calls)
44-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
44+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
4545
with:
4646
egress-policy: audit
4747

@@ -50,7 +50,7 @@ jobs:
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
53+
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
5454
with:
5555
languages: ${{ matrix.language }}
5656
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -60,7 +60,7 @@ jobs:
6060
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6161
# If this step fails, then you should remove it and run the build manually (see below)
6262
- name: Autobuild
63-
uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
63+
uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
6464

6565
# ℹ️ Command-line programs to run using the OS shell.
6666
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -73,6 +73,6 @@ jobs:
7373
# ./location_of_script_within_repo/buildscript.sh
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
76+
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
7777
with:
7878
category: "/language:${{matrix.language}}"

.github/workflows/copilot-setup-steps.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# If you do not check out your code, Copilot will do this for you.
3232
steps:
3333
- name: Harden the runner (Audit all outbound calls)
34-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
34+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3535
with:
3636
egress-policy: audit
3737

@@ -154,19 +154,19 @@ jobs:
154154
echo "Date range: $START_DATE to $END_DATE"
155155
156156
# Build command arguments
157-
ARGS="--storageAccount $AZURE_STORAGE_ACCOUNT"
158-
ARGS="$ARGS --tableName $AZURE_TABLE_NAME"
159-
ARGS="$ARGS --datasetId $AZURE_DATASET_ID"
160-
ARGS="$ARGS --startDate $START_DATE"
161-
ARGS="$ARGS --endDate $END_DATE"
162-
ARGS="$ARGS --output ./usage-data/usage-agg-daily.json"
157+
ARGS=(--storageAccount "$AZURE_STORAGE_ACCOUNT")
158+
ARGS+=(--tableName "$AZURE_TABLE_NAME")
159+
ARGS+=(--datasetId "$AZURE_DATASET_ID")
160+
ARGS+=(--startDate "$START_DATE")
161+
ARGS+=(--endDate "$END_DATE")
162+
ARGS+=(--output ./usage-data/usage-agg-daily.json)
163163
164164
# Use shared key if available, otherwise rely on Entra ID (DefaultAzureCredential)
165165
if [ -n "$AZURE_STORAGE_KEY" ]; then
166-
ARGS="$ARGS --sharedKey $AZURE_STORAGE_KEY"
166+
ARGS+=(--sharedKey "$AZURE_STORAGE_KEY")
167167
fi
168168
169-
node .github/skills/azure-storage-loader/load-table-data.js $ARGS || {
169+
node .github/skills/azure-storage-loader/load-table-data.js "${ARGS[@]}" || {
170170
echo "⚠️ Failed to download aggregated usage data, continuing without it"
171171
exit 0
172172
}

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden the runner (Audit all outbound calls)
20-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
20+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2121
with:
2222
egress-policy: audit
2323

0 commit comments

Comments
 (0)