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
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
0 commit comments