@@ -29,19 +29,21 @@ jobs:
2929
3030 steps :
3131 - name : Harden Runner
32- uses : step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
32+ uses : step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
3333 with :
3434 egress-policy : audit
3535
3636 - name : Check out the code
37- uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
37+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3838
3939 - name : Process Stale PRs
4040 env :
4141 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4242 INACTIVITY_DAYS_INPUT : ${{ github.event.inputs.inactivity_days || '60' }}
4343 WARNING_DAYS_INPUT : ${{ github.event.inputs.warning_days || '14' }}
4444 run : |
45+ set +e
46+
4547 # Validate inputs to prevent code injection
4648 if ! [[ "$INACTIVITY_DAYS_INPUT" =~ ^[0-9]+$ ]]; then
4749 echo "Error: inactivity_days must be a positive integer"
@@ -138,16 +140,20 @@ jobs:
138140 if [ $DAYS_SINCE_WARNING -ge $WARNING_DAYS ] && [ "$HAS_ACTIVITY" = false ]; then
139141 echo " Closing PR #$PR_NUMBER as Stagnant (warning period expired)"
140142
141- # Add stale label
142- gh pr edit $PR_NUMBER --add-label "stale"
143+ # Add stale label using the API directly to avoid gh cli deprecation warnings
144+ gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/labels" \
145+ --method POST \
146+ --field "labels[]=stale" > /dev/null 2>&1 || echo " Warning: Could not add stale label"
143147
144148 # Post closing comment
145149 gh pr comment $PR_NUMBER --body "This HIP has been marked as Stagnant due to inactivity. Feel free to reopen when ready to continue."
146150
147151 # Close the PR
148- gh pr close $PR_NUMBER
149-
150- echo " PR #$PR_NUMBER closed successfully"
152+ if gh pr close $PR_NUMBER; then
153+ echo " PR #$PR_NUMBER closed successfully"
154+ else
155+ echo " ERROR: Failed to close PR #$PR_NUMBER"
156+ fi
151157
152158 else
153159 if [ "$HAS_ACTIVITY" = true ]; then
0 commit comments