diff --git a/.github/workflows/ace-editor.lock.yml b/.github/workflows/ace-editor.lock.yml index 492deba71f0..41bbf585332 100644 --- a/.github/workflows/ace-editor.lock.yml +++ b/.github/workflows/ace-editor.lock.yml @@ -81,12 +81,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -657,12 +699,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/agent-performance-analyzer.lock.yml b/.github/workflows/agent-performance-analyzer.lock.yml index 0137a6fe493..2c75dae8c9a 100644 --- a/.github/workflows/agent-performance-analyzer.lock.yml +++ b/.github/workflows/agent-performance-analyzer.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -344,12 +365,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1050,12 +1092,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1190,12 +1253,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1354,12 +1438,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1399,12 +1504,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1505,12 +1631,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/agent-persona-explorer.lock.yml b/.github/workflows/agent-persona-explorer.lock.yml index de99a2fc333..8086d7da5f2 100644 --- a/.github/workflows/agent-persona-explorer.lock.yml +++ b/.github/workflows/agent-persona-explorer.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -998,12 +1040,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1134,12 +1197,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1297,12 +1381,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1353,12 +1458,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1430,12 +1556,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: agentpersonaexplorer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/agentic-observability-kit.lock.yml b/.github/workflows/agentic-observability-kit.lock.yml index 1a3be59a9c8..e5e4e0b283d 100644 --- a/.github/workflows/agentic-observability-kit.lock.yml +++ b/.github/workflows/agentic-observability-kit.lock.yml @@ -102,12 +102,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -357,12 +378,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1111,12 +1153,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1252,12 +1315,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1442,12 +1526,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1521,12 +1626,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: agenticobservabilitykit steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1571,12 +1697,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/agentic-optimization-kit.lock.yml b/.github/workflows/agentic-optimization-kit.lock.yml index edb9696ee91..1c880acd55a 100644 --- a/.github/workflows/agentic-optimization-kit.lock.yml +++ b/.github/workflows/agentic-optimization-kit.lock.yml @@ -105,12 +105,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -371,12 +392,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1165,12 +1207,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1310,12 +1373,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1484,12 +1568,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1591,12 +1696,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1670,12 +1796,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: agenticoptimizationkit steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1720,12 +1867,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index 685c2d1f10d..f1a8b93246d 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -109,12 +109,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -378,12 +399,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -991,12 +1033,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1101,12 +1164,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1183,12 +1267,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1257,12 +1362,33 @@ jobs: timeout-minutes: 5 steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/api-consumption-report.lock.yml b/.github/workflows/api-consumption-report.lock.yml index c364dd475b2..fd96fdaaead 100644 --- a/.github/workflows/api-consumption-report.lock.yml +++ b/.github/workflows/api-consumption-report.lock.yml @@ -104,12 +104,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1142,12 +1184,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1279,12 +1342,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1474,12 +1558,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1553,12 +1658,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: apiconsumptionreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1603,12 +1729,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/approach-validator.lock.yml b/.github/workflows/approach-validator.lock.yml index faca7b831de..d445d3e9c27 100644 --- a/.github/workflows/approach-validator.lock.yml +++ b/.github/workflows/approach-validator.lock.yml @@ -108,12 +108,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -377,12 +398,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1027,12 +1069,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1158,12 +1221,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1336,12 +1420,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1399,12 +1504,33 @@ jobs: upload_artifact_slot_2_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_2_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/archie.lock.yml b/.github/workflows/archie.lock.yml index 44417550d0a..7bde15384a7 100644 --- a/.github/workflows/archie.lock.yml +++ b/.github/workflows/archie.lock.yml @@ -99,12 +99,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -423,12 +444,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1004,12 +1046,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1159,12 +1222,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1324,12 +1408,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1395,12 +1500,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/architecture-guardian.lock.yml b/.github/workflows/architecture-guardian.lock.yml index c40fdaffbdc..b5765c5df74 100644 --- a/.github/workflows/architecture-guardian.lock.yml +++ b/.github/workflows/architecture-guardian.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -325,12 +346,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -910,12 +952,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1052,12 +1115,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1216,12 +1300,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1290,12 +1395,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/artifacts-summary.lock.yml b/.github/workflows/artifacts-summary.lock.yml index 018300b4b30..857cf3815ec 100644 --- a/.github/workflows/artifacts-summary.lock.yml +++ b/.github/workflows/artifacts-summary.lock.yml @@ -85,12 +85,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -321,12 +342,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -873,12 +915,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1009,12 +1072,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1194,12 +1278,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/audit-workflows.lock.yml b/.github/workflows/audit-workflows.lock.yml index 30d79f4b98f..f4f106b5739 100644 --- a/.github/workflows/audit-workflows.lock.yml +++ b/.github/workflows/audit-workflows.lock.yml @@ -107,12 +107,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -373,12 +394,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1173,12 +1215,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1314,12 +1377,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1498,12 +1582,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1599,12 +1704,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1678,12 +1804,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: auditworkflows steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1728,12 +1875,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/auto-triage-issues.lock.yml b/.github/workflows/auto-triage-issues.lock.yml index 212faad0147..f935d6708eb 100644 --- a/.github/workflows/auto-triage-issues.lock.yml +++ b/.github/workflows/auto-triage-issues.lock.yml @@ -94,12 +94,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -959,12 +1001,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1095,12 +1158,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1260,12 +1344,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1332,12 +1437,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/aw-failure-investigator.lock.yml b/.github/workflows/aw-failure-investigator.lock.yml index e8c76e67c87..ea9f69c43ef 100644 --- a/.github/workflows/aw-failure-investigator.lock.yml +++ b/.github/workflows/aw-failure-investigator.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -326,12 +347,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1088,12 +1130,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1223,12 +1286,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1419,12 +1503,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/blog-auditor.lock.yml b/.github/workflows/blog-auditor.lock.yml index cf74521b2ea..b8f7c99961e 100644 --- a/.github/workflows/blog-auditor.lock.yml +++ b/.github/workflows/blog-auditor.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -331,12 +352,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1007,12 +1049,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1144,12 +1207,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1339,12 +1423,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/bot-detection.lock.yml b/.github/workflows/bot-detection.lock.yml index 3d7f6f03748..7daa3c0ee43 100644 --- a/.github/workflows/bot-detection.lock.yml +++ b/.github/workflows/bot-detection.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -345,12 +366,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -956,12 +998,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1895,12 +1958,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/brave.lock.yml b/.github/workflows/brave.lock.yml index 227daa99a51..e4ec68a9209 100644 --- a/.github/workflows/brave.lock.yml +++ b/.github/workflows/brave.lock.yml @@ -88,12 +88,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -379,12 +400,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -950,12 +992,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1105,12 +1168,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1270,12 +1354,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1341,12 +1446,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/breaking-change-checker.lock.yml b/.github/workflows/breaking-change-checker.lock.yml index e846b204483..1ffe01b2ad1 100644 --- a/.github/workflows/breaking-change-checker.lock.yml +++ b/.github/workflows/breaking-change-checker.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -328,12 +349,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -907,12 +949,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1049,12 +1112,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1213,12 +1297,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1287,12 +1392,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/changeset.lock.yml b/.github/workflows/changeset.lock.yml index 59376157a03..7b25b3e23db 100644 --- a/.github/workflows/changeset.lock.yml +++ b/.github/workflows/changeset.lock.yml @@ -103,12 +103,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -378,12 +399,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1002,12 +1044,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1117,12 +1180,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1170,12 +1254,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/ci-coach.lock.yml b/.github/workflows/ci-coach.lock.yml index e5a9f7ebd49..a742d109257 100644 --- a/.github/workflows/ci-coach.lock.yml +++ b/.github/workflows/ci-coach.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -347,12 +368,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -976,12 +1018,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1117,12 +1180,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1305,12 +1389,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1420,12 +1525,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: cicoach steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/ci-doctor.lock.yml b/.github/workflows/ci-doctor.lock.yml index 190a6cc17b3..a0bf179df89 100644 --- a/.github/workflows/ci-doctor.lock.yml +++ b/.github/workflows/ci-doctor.lock.yml @@ -97,12 +97,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -413,12 +434,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1154,12 +1196,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1315,12 +1378,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1490,12 +1574,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1553,12 +1658,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1630,12 +1756,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: cidoctor steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/claude-code-user-docs-review.lock.yml b/.github/workflows/claude-code-user-docs-review.lock.yml index e7a13dd28d3..0fe347f08a0 100644 --- a/.github/workflows/claude-code-user-docs-review.lock.yml +++ b/.github/workflows/claude-code-user-docs-review.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -337,12 +358,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -974,12 +1016,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1112,12 +1175,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1307,12 +1391,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1384,12 +1489,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: claudecodeuserdocsreview steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/cli-consistency-checker.lock.yml b/.github/workflows/cli-consistency-checker.lock.yml index c47a38e2b99..7d752ae3cb5 100644 --- a/.github/workflows/cli-consistency-checker.lock.yml +++ b/.github/workflows/cli-consistency-checker.lock.yml @@ -82,12 +82,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -319,12 +340,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -877,12 +919,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1011,12 +1074,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1197,12 +1281,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/cli-version-checker.lock.yml b/.github/workflows/cli-version-checker.lock.yml index 9bac9826b1e..733ad575ce1 100644 --- a/.github/workflows/cli-version-checker.lock.yml +++ b/.github/workflows/cli-version-checker.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -335,12 +356,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -982,12 +1024,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1112,12 +1175,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1307,12 +1391,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1384,12 +1489,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: cliversionchecker steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml index 7774b779165..1b772a61497 100644 --- a/.github/workflows/cloclo.lock.yml +++ b/.github/workflows/cloclo.lock.yml @@ -128,12 +128,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -493,12 +514,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1324,12 +1366,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1477,12 +1540,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1652,12 +1736,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1724,12 +1829,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1839,12 +1965,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: cloclo steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/code-scanning-fixer.lock.yml b/.github/workflows/code-scanning-fixer.lock.yml index a733a178518..2d805236033 100644 --- a/.github/workflows/code-scanning-fixer.lock.yml +++ b/.github/workflows/code-scanning-fixer.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -340,12 +361,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -974,12 +1016,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1114,12 +1177,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1278,12 +1362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1336,12 +1441,33 @@ jobs: validation_failed_campaigns: ${{ steps.push_repo_memory_campaigns.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1439,12 +1565,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1554,12 +1701,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: codescanningfixer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/code-simplifier.lock.yml b/.github/workflows/code-simplifier.lock.yml index f762d02992e..7abf33f34fe 100644 --- a/.github/workflows/code-simplifier.lock.yml +++ b/.github/workflows/code-simplifier.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -906,12 +948,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1047,12 +1110,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1210,12 +1294,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1282,12 +1387,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/codex-github-remote-mcp-test.lock.yml b/.github/workflows/codex-github-remote-mcp-test.lock.yml index fc2cc2748d4..9c1f601f67d 100644 --- a/.github/workflows/codex-github-remote-mcp-test.lock.yml +++ b/.github/workflows/codex-github-remote-mcp-test.lock.yml @@ -77,12 +77,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -292,12 +313,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/commit-changes-analyzer.lock.yml b/.github/workflows/commit-changes-analyzer.lock.yml index 8afeb932fa4..61bca691e42 100644 --- a/.github/workflows/commit-changes-analyzer.lock.yml +++ b/.github/workflows/commit-changes-analyzer.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -934,12 +976,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1066,12 +1129,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1260,12 +1344,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/constraint-solving-potd.lock.yml b/.github/workflows/constraint-solving-potd.lock.yml index a5755d5f0e6..e7c584318f5 100644 --- a/.github/workflows/constraint-solving-potd.lock.yml +++ b/.github/workflows/constraint-solving-potd.lock.yml @@ -81,12 +81,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -324,12 +345,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -884,12 +926,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1019,12 +1082,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1203,12 +1287,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1280,12 +1385,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: constraintsolvingpotd steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/contribution-check.lock.yml b/.github/workflows/contribution-check.lock.yml index 978f136f7fd..566a3e502ab 100644 --- a/.github/workflows/contribution-check.lock.yml +++ b/.github/workflows/contribution-check.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1004,12 +1046,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1138,12 +1201,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1327,12 +1411,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-agent-analysis.lock.yml b/.github/workflows/copilot-agent-analysis.lock.yml index 32314fc9a15..8ebc894d3ad 100644 --- a/.github/workflows/copilot-agent-analysis.lock.yml +++ b/.github/workflows/copilot-agent-analysis.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -355,12 +376,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1023,12 +1065,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1159,12 +1222,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1343,12 +1427,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1443,12 +1548,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1520,12 +1646,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotagentanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-cli-deep-research.lock.yml b/.github/workflows/copilot-cli-deep-research.lock.yml index 90bdf6dd696..01cc1c3435d 100644 --- a/.github/workflows/copilot-cli-deep-research.lock.yml +++ b/.github/workflows/copilot-cli-deep-research.lock.yml @@ -84,12 +84,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -338,12 +359,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -933,12 +975,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1073,12 +1136,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1247,12 +1331,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1348,12 +1453,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-opt.lock.yml b/.github/workflows/copilot-opt.lock.yml index 50c0ae4a917..d34cd9ca1b5 100644 --- a/.github/workflows/copilot-opt.lock.yml +++ b/.github/workflows/copilot-opt.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -975,12 +1017,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1109,12 +1172,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1294,12 +1378,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1371,12 +1476,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotopt steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-pr-merged-report.lock.yml b/.github/workflows/copilot-pr-merged-report.lock.yml index 93d1129cce5..3f75dc79f0f 100644 --- a/.github/workflows/copilot-pr-merged-report.lock.yml +++ b/.github/workflows/copilot-pr-merged-report.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -290,12 +311,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -968,12 +1010,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1104,12 +1167,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1289,12 +1373,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1366,12 +1471,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotprmergedreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-pr-nlp-analysis.lock.yml b/.github/workflows/copilot-pr-nlp-analysis.lock.yml index 996d161c051..9e4dd7b6a4e 100644 --- a/.github/workflows/copilot-pr-nlp-analysis.lock.yml +++ b/.github/workflows/copilot-pr-nlp-analysis.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -360,12 +381,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1023,12 +1065,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1163,12 +1226,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1337,12 +1421,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1438,12 +1543,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1515,12 +1641,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotprnlpanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1565,12 +1712,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-pr-prompt-analysis.lock.yml b/.github/workflows/copilot-pr-prompt-analysis.lock.yml index cc8542e1f0a..1f6465b9ea5 100644 --- a/.github/workflows/copilot-pr-prompt-analysis.lock.yml +++ b/.github/workflows/copilot-pr-prompt-analysis.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -353,12 +374,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -963,12 +1005,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1103,12 +1166,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1277,12 +1361,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1378,12 +1483,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1455,12 +1581,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotprpromptanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-session-insights.lock.yml b/.github/workflows/copilot-session-insights.lock.yml index 15adb6cfe64..8266c1a0648 100644 --- a/.github/workflows/copilot-session-insights.lock.yml +++ b/.github/workflows/copilot-session-insights.lock.yml @@ -97,12 +97,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -367,12 +388,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1081,12 +1123,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1217,12 +1280,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1401,12 +1485,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1501,12 +1606,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1578,12 +1704,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilotsessioninsights steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1628,12 +1775,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-token-audit.lock.yml b/.github/workflows/copilot-token-audit.lock.yml index 8ebe52ce61a..1c8c0e6c88b 100644 --- a/.github/workflows/copilot-token-audit.lock.yml +++ b/.github/workflows/copilot-token-audit.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -357,12 +378,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1095,12 +1137,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1240,12 +1303,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1414,12 +1498,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1516,12 +1621,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1593,12 +1719,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: copilottokenaudit steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1643,12 +1790,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/copilot-token-optimizer.lock.yml b/.github/workflows/copilot-token-optimizer.lock.yml index 5304445cd96..5ae92280892 100644 --- a/.github/workflows/copilot-token-optimizer.lock.yml +++ b/.github/workflows/copilot-token-optimizer.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -344,12 +365,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -954,12 +996,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1082,12 +1145,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1182,12 +1266,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/craft.lock.yml b/.github/workflows/craft.lock.yml index a83e63a6565..3981b2d42de 100644 --- a/.github/workflows/craft.lock.yml +++ b/.github/workflows/craft.lock.yml @@ -86,12 +86,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -378,12 +399,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -953,12 +995,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1110,12 +1173,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1275,12 +1359,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1348,12 +1453,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-architecture-diagram.lock.yml b/.github/workflows/daily-architecture-diagram.lock.yml index c2a9cb6d96b..7db13e4c294 100644 --- a/.github/workflows/daily-architecture-diagram.lock.yml +++ b/.github/workflows/daily-architecture-diagram.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -990,12 +1032,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1126,12 +1189,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1315,12 +1399,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1432,12 +1537,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyarchitecturediagram steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-assign-issue-to-user.lock.yml b/.github/workflows/daily-assign-issue-to-user.lock.yml index 18493ac568c..7fc0a402812 100644 --- a/.github/workflows/daily-assign-issue-to-user.lock.yml +++ b/.github/workflows/daily-assign-issue-to-user.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -917,12 +959,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1051,12 +1114,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1240,12 +1324,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml b/.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml index c61ec2db05b..e40ffe11fec 100644 --- a/.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml +++ b/.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml @@ -83,12 +83,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -322,12 +343,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -949,12 +991,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1086,12 +1149,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1282,12 +1366,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-aw-cross-repo-compile-check.lock.yml b/.github/workflows/daily-aw-cross-repo-compile-check.lock.yml index 9d702a07608..e23e2c61a75 100644 --- a/.github/workflows/daily-aw-cross-repo-compile-check.lock.yml +++ b/.github/workflows/daily-aw-cross-repo-compile-check.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -331,12 +352,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -976,12 +1018,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1112,12 +1175,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1308,12 +1392,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1385,12 +1490,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyawcrossrepocompilecheck steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-choice-test.lock.yml b/.github/workflows/daily-choice-test.lock.yml index 00c90c3e0e4..391a68d4272 100644 --- a/.github/workflows/daily-choice-test.lock.yml +++ b/.github/workflows/daily-choice-test.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -331,12 +352,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -959,12 +1001,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1094,12 +1157,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1287,12 +1371,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-cli-performance.lock.yml b/.github/workflows/daily-cli-performance.lock.yml index a9674482c8a..b44ad41a46b 100644 --- a/.github/workflows/daily-cli-performance.lock.yml +++ b/.github/workflows/daily-cli-performance.lock.yml @@ -121,12 +121,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -384,12 +405,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1158,12 +1200,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1301,12 +1364,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1467,12 +1551,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1532,12 +1637,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1639,12 +1765,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-cli-tools-tester.lock.yml b/.github/workflows/daily-cli-tools-tester.lock.yml index 8f49e64d1f6..df5936e32c5 100644 --- a/.github/workflows/daily-cli-tools-tester.lock.yml +++ b/.github/workflows/daily-cli-tools-tester.lock.yml @@ -96,12 +96,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -996,12 +1038,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1130,12 +1193,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1315,12 +1399,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-code-metrics.lock.yml b/.github/workflows/daily-code-metrics.lock.yml index c1125682a8b..b883a80a7d5 100644 --- a/.github/workflows/daily-code-metrics.lock.yml +++ b/.github/workflows/daily-code-metrics.lock.yml @@ -102,12 +102,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -365,12 +386,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1088,12 +1130,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1229,12 +1292,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1413,12 +1497,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1514,12 +1619,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1593,12 +1719,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailycodemetrics steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1643,12 +1790,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-community-attribution.lock.yml b/.github/workflows/daily-community-attribution.lock.yml index 05f38a539fb..bf0111dd70a 100644 --- a/.github/workflows/daily-community-attribution.lock.yml +++ b/.github/workflows/daily-community-attribution.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -351,12 +372,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1005,12 +1047,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1145,12 +1208,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1318,12 +1402,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1421,12 +1526,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-compiler-quality.lock.yml b/.github/workflows/daily-compiler-quality.lock.yml index febfbbbd34c..4f159c75df7 100644 --- a/.github/workflows/daily-compiler-quality.lock.yml +++ b/.github/workflows/daily-compiler-quality.lock.yml @@ -100,12 +100,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -381,12 +402,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1040,12 +1082,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1181,12 +1244,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1367,12 +1451,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1446,12 +1551,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailycompilerquality steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-doc-healer.lock.yml b/.github/workflows/daily-doc-healer.lock.yml index 7b85f6c411c..11d880bb402 100644 --- a/.github/workflows/daily-doc-healer.lock.yml +++ b/.github/workflows/daily-doc-healer.lock.yml @@ -98,12 +98,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -348,12 +369,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1079,12 +1121,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1218,12 +1281,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1419,12 +1503,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1552,12 +1657,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailydochealer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-doc-updater.lock.yml b/.github/workflows/daily-doc-updater.lock.yml index a4d4d746f49..fa09c3195cf 100644 --- a/.github/workflows/daily-doc-updater.lock.yml +++ b/.github/workflows/daily-doc-updater.lock.yml @@ -98,12 +98,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -347,12 +368,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1046,12 +1088,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1183,12 +1246,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1380,12 +1464,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1497,12 +1602,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailydocupdater steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-fact.lock.yml b/.github/workflows/daily-fact.lock.yml index f9664a230a4..a661d770e5f 100644 --- a/.github/workflows/daily-fact.lock.yml +++ b/.github/workflows/daily-fact.lock.yml @@ -101,12 +101,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -442,12 +463,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1131,12 +1173,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1267,12 +1330,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1392,18 +1476,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_abcc318f67e82099_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_838f0efb4659d92e_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_abcc318f67e82099_EOF + GH_AW_MCP_CONFIG_838f0efb4659d92e_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_9942d2228d1157a1_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_0a117432cba8a907_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1414,11 +1498,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_9942d2228d1157a1_EOF + GH_AW_MCP_CONFIG_0a117432cba8a907_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_a515e10253c864a8_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_d64cd77d6968b451_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1428,7 +1512,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_a515e10253c864a8_EOF + GH_AW_CODEX_SHELL_POLICY_d64cd77d6968b451_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1522,12 +1606,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1601,12 +1706,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyfact steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-file-diet.lock.yml b/.github/workflows/daily-file-diet.lock.yml index db3be5a5a7d..ded8191bd50 100644 --- a/.github/workflows/daily-file-diet.lock.yml +++ b/.github/workflows/daily-file-diet.lock.yml @@ -101,12 +101,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -379,12 +400,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1014,12 +1056,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1153,12 +1216,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1317,12 +1401,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1388,12 +1493,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-firewall-report.lock.yml b/.github/workflows/daily-firewall-report.lock.yml index b39182e3c44..61ac392e114 100644 --- a/.github/workflows/daily-firewall-report.lock.yml +++ b/.github/workflows/daily-firewall-report.lock.yml @@ -104,12 +104,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -360,12 +381,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1079,12 +1121,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1220,12 +1283,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1405,12 +1489,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1484,12 +1589,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyfirewallreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1534,12 +1660,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-function-namer.lock.yml b/.github/workflows/daily-function-namer.lock.yml index 7de8d344d8c..d15bbb1c03a 100644 --- a/.github/workflows/daily-function-namer.lock.yml +++ b/.github/workflows/daily-function-namer.lock.yml @@ -99,12 +99,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -380,12 +401,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1071,12 +1113,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1206,12 +1269,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1402,12 +1486,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1481,12 +1586,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyfunctionnamer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-hippo-learn.lock.yml b/.github/workflows/daily-hippo-learn.lock.yml index fc5f7299446..fe0eeb86207 100644 --- a/.github/workflows/daily-hippo-learn.lock.yml +++ b/.github/workflows/daily-hippo-learn.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1043,12 +1085,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1184,12 +1247,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1370,12 +1454,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1447,12 +1552,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyhippolearn steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-integrity-analysis.lock.yml b/.github/workflows/daily-integrity-analysis.lock.yml index 2c105b4daf7..a35315aa2db 100644 --- a/.github/workflows/daily-integrity-analysis.lock.yml +++ b/.github/workflows/daily-integrity-analysis.lock.yml @@ -101,12 +101,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -358,12 +379,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1093,12 +1135,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1234,12 +1297,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1419,12 +1503,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1498,12 +1603,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyintegrityanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1548,12 +1674,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-issues-report.lock.yml b/.github/workflows/daily-issues-report.lock.yml index 04ce7ebf2b8..f48e99b2963 100644 --- a/.github/workflows/daily-issues-report.lock.yml +++ b/.github/workflows/daily-issues-report.lock.yml @@ -108,12 +108,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -372,12 +393,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1198,12 +1240,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1339,12 +1402,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1502,12 +1586,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1559,12 +1664,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1638,12 +1764,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyissuesreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1688,12 +1835,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-malicious-code-scan.lock.yml b/.github/workflows/daily-malicious-code-scan.lock.yml index 1815a8c6620..7a6c4747b43 100644 --- a/.github/workflows/daily-malicious-code-scan.lock.yml +++ b/.github/workflows/daily-malicious-code-scan.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -334,12 +355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -915,12 +957,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1050,12 +1113,33 @@ jobs: sarif_file: ${{ steps.process_safe_outputs.outputs.sarif_file }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-mcp-concurrency-analysis.lock.yml b/.github/workflows/daily-mcp-concurrency-analysis.lock.yml index f53d37a604d..8b4afcb8709 100644 --- a/.github/workflows/daily-mcp-concurrency-analysis.lock.yml +++ b/.github/workflows/daily-mcp-concurrency-analysis.lock.yml @@ -97,12 +97,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -377,12 +398,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1055,12 +1097,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1194,12 +1257,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1383,12 +1467,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1463,12 +1568,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailymcpconcurrencyanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-multi-device-docs-tester.lock.yml b/.github/workflows/daily-multi-device-docs-tester.lock.yml index e0505f70971..d531c6ae0ae 100644 --- a/.github/workflows/daily-multi-device-docs-tester.lock.yml +++ b/.github/workflows/daily-multi-device-docs-tester.lock.yml @@ -100,12 +100,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -349,12 +370,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1069,12 +1111,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1204,12 +1267,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1404,12 +1488,33 @@ jobs: upload_artifact_slot_2_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_2_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-news.lock.yml b/.github/workflows/daily-news.lock.yml index ebe0110109a..f1033b82080 100644 --- a/.github/workflows/daily-news.lock.yml +++ b/.github/workflows/daily-news.lock.yml @@ -103,12 +103,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -371,12 +392,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1147,12 +1189,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1292,12 +1355,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1466,12 +1550,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1572,12 +1677,33 @@ jobs: upload_artifact_slot_2_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_2_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1658,12 +1784,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailynews steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1708,12 +1855,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-observability-report.lock.yml b/.github/workflows/daily-observability-report.lock.yml index fd677f9d61d..56f361739c6 100644 --- a/.github/workflows/daily-observability-report.lock.yml +++ b/.github/workflows/daily-observability-report.lock.yml @@ -103,12 +103,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -350,12 +371,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1046,12 +1088,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1183,12 +1246,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1308,18 +1392,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_20bd754d455f5880_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_442ecba677df4542_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_20bd754d455f5880_EOF + GH_AW_MCP_CONFIG_442ecba677df4542_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_0f19141a301abe72_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_b58b91207fc63faf_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1330,11 +1414,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_0f19141a301abe72_EOF + GH_AW_MCP_CONFIG_b58b91207fc63faf_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_286c4cdc05675573_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_5c16bbcf524eaa9a_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1344,7 +1428,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_286c4cdc05675573_EOF + GH_AW_CODEX_SHELL_POLICY_5c16bbcf524eaa9a_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1413,12 +1497,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1469,12 +1574,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-otel-instrumentation-advisor.lock.yml b/.github/workflows/daily-otel-instrumentation-advisor.lock.yml index 49ab0dd99dd..79d161d83a0 100644 --- a/.github/workflows/daily-otel-instrumentation-advisor.lock.yml +++ b/.github/workflows/daily-otel-instrumentation-advisor.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -994,12 +1036,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1129,12 +1192,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1325,12 +1409,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-performance-summary.lock.yml b/.github/workflows/daily-performance-summary.lock.yml index fefe98a92a6..a942e956902 100644 --- a/.github/workflows/daily-performance-summary.lock.yml +++ b/.github/workflows/daily-performance-summary.lock.yml @@ -102,12 +102,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -359,12 +380,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1487,12 +1529,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1628,12 +1691,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1813,12 +1897,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1892,12 +1997,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyperformancesummary steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1942,12 +2068,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-regulatory.lock.yml b/.github/workflows/daily-regulatory.lock.yml index 60e1af978e7..f0070736543 100644 --- a/.github/workflows/daily-regulatory.lock.yml +++ b/.github/workflows/daily-regulatory.lock.yml @@ -97,12 +97,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -344,12 +365,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1400,12 +1442,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1541,12 +1604,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1726,12 +1810,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-rendering-scripts-verifier.lock.yml b/.github/workflows/daily-rendering-scripts-verifier.lock.yml index d458808894e..f72bf4d21d7 100644 --- a/.github/workflows/daily-rendering-scripts-verifier.lock.yml +++ b/.github/workflows/daily-rendering-scripts-verifier.lock.yml @@ -106,12 +106,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -363,12 +384,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1142,12 +1184,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1279,12 +1342,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1453,12 +1537,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1524,12 +1629,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1641,12 +1767,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyrenderingscriptsverifier steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-repo-chronicle.lock.yml b/.github/workflows/daily-repo-chronicle.lock.yml index 9a0c910f63d..489d771de76 100644 --- a/.github/workflows/daily-repo-chronicle.lock.yml +++ b/.github/workflows/daily-repo-chronicle.lock.yml @@ -98,12 +98,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -350,12 +371,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -995,12 +1037,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1136,12 +1199,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1322,12 +1406,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1401,12 +1506,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailyrepochronicle steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1451,12 +1577,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-safe-output-integrator.lock.yml b/.github/workflows/daily-safe-output-integrator.lock.yml index 3781da3a600..3fd4d9369ce 100644 --- a/.github/workflows/daily-safe-output-integrator.lock.yml +++ b/.github/workflows/daily-safe-output-integrator.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -336,12 +357,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -957,12 +999,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1098,12 +1161,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1286,12 +1370,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-safe-output-optimizer.lock.yml b/.github/workflows/daily-safe-output-optimizer.lock.yml index 58053c97dda..bf833732cb0 100644 --- a/.github/workflows/daily-safe-output-optimizer.lock.yml +++ b/.github/workflows/daily-safe-output-optimizer.lock.yml @@ -107,12 +107,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1124,12 +1166,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1254,12 +1317,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1428,12 +1512,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1497,12 +1602,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1576,12 +1702,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: dailysafeoutputoptimizer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-safe-outputs-conformance.lock.yml b/.github/workflows/daily-safe-outputs-conformance.lock.yml index e9c62881ffb..68637df6502 100644 --- a/.github/workflows/daily-safe-outputs-conformance.lock.yml +++ b/.github/workflows/daily-safe-outputs-conformance.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -334,12 +355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -965,12 +1007,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1100,12 +1163,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1296,12 +1380,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-secrets-analysis.lock.yml b/.github/workflows/daily-secrets-analysis.lock.yml index 4b0b5e48738..19c0da242a9 100644 --- a/.github/workflows/daily-secrets-analysis.lock.yml +++ b/.github/workflows/daily-secrets-analysis.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -335,12 +356,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -906,12 +948,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1047,12 +1110,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1233,12 +1317,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-security-red-team.lock.yml b/.github/workflows/daily-security-red-team.lock.yml index 0aadb0e6a3c..30562d19e8b 100644 --- a/.github/workflows/daily-security-red-team.lock.yml +++ b/.github/workflows/daily-security-red-team.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -342,12 +363,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -973,12 +1015,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1109,12 +1172,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1305,12 +1389,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-semgrep-scan.lock.yml b/.github/workflows/daily-semgrep-scan.lock.yml index 52299aef3ac..7fe16e4f8c2 100644 --- a/.github/workflows/daily-semgrep-scan.lock.yml +++ b/.github/workflows/daily-semgrep-scan.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -335,12 +356,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -941,12 +983,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1075,12 +1138,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1260,12 +1344,33 @@ jobs: sarif_file: ${{ steps.process_safe_outputs.outputs.sarif_file }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-skill-optimizer.lock.yml b/.github/workflows/daily-skill-optimizer.lock.yml index dc7910fad6d..2182bec18ee 100644 --- a/.github/workflows/daily-skill-optimizer.lock.yml +++ b/.github/workflows/daily-skill-optimizer.lock.yml @@ -82,12 +82,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -323,12 +344,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -888,12 +930,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1027,12 +1090,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1213,12 +1297,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-syntax-error-quality.lock.yml b/.github/workflows/daily-syntax-error-quality.lock.yml index 075a7fba897..f7415ac6c10 100644 --- a/.github/workflows/daily-syntax-error-quality.lock.yml +++ b/.github/workflows/daily-syntax-error-quality.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -334,12 +355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -946,12 +988,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1085,12 +1148,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1272,12 +1356,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-team-evolution-insights.lock.yml b/.github/workflows/daily-team-evolution-insights.lock.yml index ab7d14744a0..1d46c6debd0 100644 --- a/.github/workflows/daily-team-evolution-insights.lock.yml +++ b/.github/workflows/daily-team-evolution-insights.lock.yml @@ -97,12 +97,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -964,12 +1006,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1101,12 +1164,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1296,12 +1380,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-team-status.lock.yml b/.github/workflows/daily-team-status.lock.yml index a0389dfe900..3d750f66da5 100644 --- a/.github/workflows/daily-team-status.lock.yml +++ b/.github/workflows/daily-team-status.lock.yml @@ -104,12 +104,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -350,12 +371,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -927,12 +969,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1076,12 +1139,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1239,12 +1323,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1299,12 +1404,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-testify-uber-super-expert.lock.yml b/.github/workflows/daily-testify-uber-super-expert.lock.yml index 827007096e7..123df329693 100644 --- a/.github/workflows/daily-testify-uber-super-expert.lock.yml +++ b/.github/workflows/daily-testify-uber-super-expert.lock.yml @@ -101,12 +101,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -393,12 +414,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1052,12 +1094,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1195,12 +1258,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1359,12 +1443,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1417,12 +1522,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1520,12 +1646,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-token-consumption-report.lock.yml b/.github/workflows/daily-token-consumption-report.lock.yml index 84e52428b06..8af3aca39d8 100644 --- a/.github/workflows/daily-token-consumption-report.lock.yml +++ b/.github/workflows/daily-token-consumption-report.lock.yml @@ -99,12 +99,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1034,12 +1076,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1169,12 +1232,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1365,12 +1449,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/daily-workflow-updater.lock.yml b/.github/workflows/daily-workflow-updater.lock.yml index 08925a17d63..8c57b2c0fe5 100644 --- a/.github/workflows/daily-workflow-updater.lock.yml +++ b/.github/workflows/daily-workflow-updater.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -918,12 +960,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1059,12 +1122,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1247,12 +1331,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dead-code-remover.lock.yml b/.github/workflows/dead-code-remover.lock.yml index bd79e91df7f..3eaacca3983 100644 --- a/.github/workflows/dead-code-remover.lock.yml +++ b/.github/workflows/dead-code-remover.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -947,12 +989,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1083,12 +1146,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1247,12 +1331,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1318,12 +1423,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1433,12 +1559,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: deadcoderemover steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/deep-report.lock.yml b/.github/workflows/deep-report.lock.yml index 52c876ea420..a1ab34d5069 100644 --- a/.github/workflows/deep-report.lock.yml +++ b/.github/workflows/deep-report.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -358,12 +379,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1156,12 +1198,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1297,12 +1360,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1481,12 +1565,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1586,12 +1691,33 @@ jobs: upload_artifact_slot_0_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_0_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1670,12 +1796,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: deepreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/delight.lock.yml b/.github/workflows/delight.lock.yml index 67e7c3103a1..a4929d90b91 100644 --- a/.github/workflows/delight.lock.yml +++ b/.github/workflows/delight.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -340,12 +361,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -973,12 +1015,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1119,12 +1182,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1293,12 +1377,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1398,12 +1503,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dependabot-burner.lock.yml b/.github/workflows/dependabot-burner.lock.yml index 5bebcf13125..3463b30849f 100644 --- a/.github/workflows/dependabot-burner.lock.yml +++ b/.github/workflows/dependabot-burner.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -329,12 +350,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -887,12 +929,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1021,12 +1084,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1184,12 +1268,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1241,12 +1346,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dependabot-go-checker.lock.yml b/.github/workflows/dependabot-go-checker.lock.yml index ce54af4f444..9ea8860f303 100644 --- a/.github/workflows/dependabot-go-checker.lock.yml +++ b/.github/workflows/dependabot-go-checker.lock.yml @@ -85,12 +85,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -328,12 +349,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -905,12 +947,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1039,12 +1102,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1224,12 +1308,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/design-decision-gate.lock.yml b/.github/workflows/design-decision-gate.lock.yml index 0ab50a3255b..67bae32a08f 100644 --- a/.github/workflows/design-decision-gate.lock.yml +++ b/.github/workflows/design-decision-gate.lock.yml @@ -101,12 +101,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -363,12 +384,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1033,12 +1075,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1166,12 +1229,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1343,12 +1427,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1404,12 +1509,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dev-hawk.lock.yml b/.github/workflows/dev-hawk.lock.yml index 3bdfcbfddf5..52f1e5250f5 100644 --- a/.github/workflows/dev-hawk.lock.yml +++ b/.github/workflows/dev-hawk.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -355,12 +376,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -998,12 +1040,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1133,12 +1196,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1298,12 +1382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1358,12 +1463,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dev.lock.yml b/.github/workflows/dev.lock.yml index dc7a4ad285e..8ac773321f2 100644 --- a/.github/workflows/dev.lock.yml +++ b/.github/workflows/dev.lock.yml @@ -105,12 +105,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -376,12 +397,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -934,12 +976,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1087,12 +1150,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1255,12 +1339,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1312,12 +1417,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/developer-docs-consolidator.lock.yml b/.github/workflows/developer-docs-consolidator.lock.yml index 1efee9a2fee..6eb45780df5 100644 --- a/.github/workflows/developer-docs-consolidator.lock.yml +++ b/.github/workflows/developer-docs-consolidator.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -387,12 +408,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1143,12 +1185,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1281,12 +1344,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1465,12 +1549,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1568,12 +1673,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1683,12 +1809,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: developerdocsconsolidator steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/dictation-prompt.lock.yml b/.github/workflows/dictation-prompt.lock.yml index 07d6a31ce5d..851882f454b 100644 --- a/.github/workflows/dictation-prompt.lock.yml +++ b/.github/workflows/dictation-prompt.lock.yml @@ -85,12 +85,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -323,12 +344,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -890,12 +932,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1026,12 +1089,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1213,12 +1297,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/discussion-task-miner.lock.yml b/.github/workflows/discussion-task-miner.lock.yml index fdedfd8a407..88ce6177b91 100644 --- a/.github/workflows/discussion-task-miner.lock.yml +++ b/.github/workflows/discussion-task-miner.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -968,12 +1010,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1112,12 +1175,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1286,12 +1370,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1394,12 +1499,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/docs-noob-tester.lock.yml b/.github/workflows/docs-noob-tester.lock.yml index 67fbd4314d6..66a6aec89a3 100644 --- a/.github/workflows/docs-noob-tester.lock.yml +++ b/.github/workflows/docs-noob-tester.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -331,12 +352,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -935,12 +977,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1071,12 +1134,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1256,12 +1340,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1332,12 +1437,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/draft-pr-cleanup.lock.yml b/.github/workflows/draft-pr-cleanup.lock.yml index 227f40b0bdc..38053fbaceb 100644 --- a/.github/workflows/draft-pr-cleanup.lock.yml +++ b/.github/workflows/draft-pr-cleanup.lock.yml @@ -82,12 +82,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -317,12 +338,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -922,12 +964,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1057,12 +1120,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1246,12 +1330,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/duplicate-code-detector.lock.yml b/.github/workflows/duplicate-code-detector.lock.yml index 77e0b05415e..5e44c33699c 100644 --- a/.github/workflows/duplicate-code-detector.lock.yml +++ b/.github/workflows/duplicate-code-detector.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -367,12 +388,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1008,12 +1050,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1140,12 +1203,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1265,18 +1349,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_5c69b70f5aec0ca6_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_cbf428e64d6a302c_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_5c69b70f5aec0ca6_EOF + GH_AW_MCP_CONFIG_cbf428e64d6a302c_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_4466cf9782c69339_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_91d083b4b8d4de72_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1287,11 +1371,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_4466cf9782c69339_EOF + GH_AW_MCP_CONFIG_91d083b4b8d4de72_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_e23db77d154bd0b1_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_4d2444fd8234c191_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1301,7 +1385,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_e23db77d154bd0b1_EOF + GH_AW_CODEX_SHELL_POLICY_4d2444fd8234c191_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1393,12 +1477,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/example-permissions-warning.lock.yml b/.github/workflows/example-permissions-warning.lock.yml index 2aad0ac2bda..9566ef60cde 100644 --- a/.github/workflows/example-permissions-warning.lock.yml +++ b/.github/workflows/example-permissions-warning.lock.yml @@ -76,12 +76,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -294,12 +315,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/example-workflow-analyzer.lock.yml b/.github/workflows/example-workflow-analyzer.lock.yml index b3440a0d181..214a559a437 100644 --- a/.github/workflows/example-workflow-analyzer.lock.yml +++ b/.github/workflows/example-workflow-analyzer.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -328,12 +349,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1010,12 +1052,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1142,12 +1205,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1336,12 +1420,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/firewall-escape.lock.yml b/.github/workflows/firewall-escape.lock.yml index f6537fbe77f..382e021d149 100644 --- a/.github/workflows/firewall-escape.lock.yml +++ b/.github/workflows/firewall-escape.lock.yml @@ -97,12 +97,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -367,12 +388,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -967,12 +1009,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1112,12 +1175,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1317,12 +1401,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1362,12 +1467,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1463,12 +1589,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1540,12 +1687,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: firewallescape steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/firewall.lock.yml b/.github/workflows/firewall.lock.yml index 56e49aa90bc..981dd89a073 100644 --- a/.github/workflows/firewall.lock.yml +++ b/.github/workflows/firewall.lock.yml @@ -76,12 +76,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -296,12 +317,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/functional-pragmatist.lock.yml b/.github/workflows/functional-pragmatist.lock.yml index 41663bbb8c1..e13e07b8eb0 100644 --- a/.github/workflows/functional-pragmatist.lock.yml +++ b/.github/workflows/functional-pragmatist.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -330,12 +351,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -897,12 +939,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1038,12 +1101,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1225,12 +1309,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/github-mcp-structural-analysis.lock.yml b/.github/workflows/github-mcp-structural-analysis.lock.yml index fb66be087a3..fa5df096d83 100644 --- a/.github/workflows/github-mcp-structural-analysis.lock.yml +++ b/.github/workflows/github-mcp-structural-analysis.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -342,12 +363,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1026,12 +1068,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1158,12 +1221,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1352,12 +1436,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1429,12 +1534,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: githubmcpstructuralanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1479,12 +1605,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/github-mcp-tools-report.lock.yml b/.github/workflows/github-mcp-tools-report.lock.yml index 71ee033ad07..1cdd021e659 100644 --- a/.github/workflows/github-mcp-tools-report.lock.yml +++ b/.github/workflows/github-mcp-tools-report.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1019,12 +1061,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1153,12 +1216,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1350,12 +1434,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1465,12 +1570,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: githubmcptoolsreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/github-remote-mcp-auth-test.lock.yml b/.github/workflows/github-remote-mcp-auth-test.lock.yml index 4efa1e367d9..5d759566a64 100644 --- a/.github/workflows/github-remote-mcp-auth-test.lock.yml +++ b/.github/workflows/github-remote-mcp-auth-test.lock.yml @@ -85,12 +85,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -329,12 +350,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -890,12 +932,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1026,12 +1089,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1210,12 +1294,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/glossary-maintainer.lock.yml b/.github/workflows/glossary-maintainer.lock.yml index 825bf3c99ae..e856a83c5bc 100644 --- a/.github/workflows/glossary-maintainer.lock.yml +++ b/.github/workflows/glossary-maintainer.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -392,12 +413,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1052,12 +1094,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1192,12 +1255,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1365,12 +1449,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1468,12 +1573,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1583,12 +1709,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: glossarymaintainer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/go-fan.lock.yml b/.github/workflows/go-fan.lock.yml index b0fd3b14917..44c1c623831 100644 --- a/.github/workflows/go-fan.lock.yml +++ b/.github/workflows/go-fan.lock.yml @@ -94,12 +94,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -373,12 +394,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1067,12 +1109,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1204,12 +1267,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1399,12 +1483,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1476,12 +1581,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: gofan steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/go-logger.lock.yml b/.github/workflows/go-logger.lock.yml index 71b739b0eca..cad8b3f38e3 100644 --- a/.github/workflows/go-logger.lock.yml +++ b/.github/workflows/go-logger.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -336,12 +357,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1187,12 +1229,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1319,12 +1382,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1515,12 +1599,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1630,12 +1735,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: gologger steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/go-pattern-detector.lock.yml b/.github/workflows/go-pattern-detector.lock.yml index 36e46024f1c..cb485115b7c 100644 --- a/.github/workflows/go-pattern-detector.lock.yml +++ b/.github/workflows/go-pattern-detector.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -334,12 +355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1007,12 +1049,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1137,12 +1200,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1332,12 +1416,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/gpclean.lock.yml b/.github/workflows/gpclean.lock.yml index 804a94a158f..6f96ac2aafe 100644 --- a/.github/workflows/gpclean.lock.yml +++ b/.github/workflows/gpclean.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -334,12 +355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -925,12 +967,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1059,12 +1122,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1244,12 +1328,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1321,12 +1426,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: gpclean steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/grumpy-reviewer.lock.yml b/.github/workflows/grumpy-reviewer.lock.yml index 2fd3d0e794a..395aeed7e4c 100644 --- a/.github/workflows/grumpy-reviewer.lock.yml +++ b/.github/workflows/grumpy-reviewer.lock.yml @@ -101,12 +101,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -396,12 +417,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1046,12 +1088,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1197,12 +1260,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1322,18 +1406,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_b5530d8a9a2714e7_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_5266bb15510ee422_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_b5530d8a9a2714e7_EOF + GH_AW_MCP_CONFIG_5266bb15510ee422_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_ea5fde9961faa423_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_fd6c969918f58048_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1344,11 +1428,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_ea5fde9961faa423_EOF + GH_AW_MCP_CONFIG_fd6c969918f58048_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_7324bbd39816336b_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_b7596cefe274950d_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1358,7 +1442,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_7324bbd39816336b_EOF + GH_AW_CODEX_SHELL_POLICY_b7596cefe274950d_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1428,12 +1512,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1494,12 +1599,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1571,12 +1697,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: grumpyreviewer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/hourly-ci-cleaner.lock.yml b/.github/workflows/hourly-ci-cleaner.lock.yml index f24687e2ca1..354422639ad 100644 --- a/.github/workflows/hourly-ci-cleaner.lock.yml +++ b/.github/workflows/hourly-ci-cleaner.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1051,12 +1093,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1189,12 +1252,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1386,12 +1470,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/instructions-janitor.lock.yml b/.github/workflows/instructions-janitor.lock.yml index 17e4a1f625c..7a61832ac1b 100644 --- a/.github/workflows/instructions-janitor.lock.yml +++ b/.github/workflows/instructions-janitor.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1007,12 +1049,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1139,12 +1202,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1335,12 +1419,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1450,12 +1555,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: instructionsjanitor steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/issue-arborist.lock.yml b/.github/workflows/issue-arborist.lock.yml index 0f73ab37b67..5625548f0a2 100644 --- a/.github/workflows/issue-arborist.lock.yml +++ b/.github/workflows/issue-arborist.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1044,12 +1086,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1176,12 +1239,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1301,18 +1385,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_c6efc0349e218c3a_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_047099d6b6209025_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_c6efc0349e218c3a_EOF + GH_AW_MCP_CONFIG_047099d6b6209025_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_7f8a6b4901179a87_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_7f280fa0495b5fd6_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1323,11 +1407,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_7f8a6b4901179a87_EOF + GH_AW_MCP_CONFIG_7f280fa0495b5fd6_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_e8e9a5f6905265d6_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_c4855b508d1ea54a_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1337,7 +1421,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_e8e9a5f6905265d6_EOF + GH_AW_CODEX_SHELL_POLICY_c4855b508d1ea54a_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1428,12 +1512,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/issue-monster.lock.yml b/.github/workflows/issue-monster.lock.yml index fef116f58c8..b52cf98f338 100644 --- a/.github/workflows/issue-monster.lock.yml +++ b/.github/workflows/issue-monster.lock.yml @@ -465,12 +465,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -723,12 +744,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1299,12 +1341,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1436,12 +1499,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1607,12 +1691,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2070,12 +2175,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/issue-triage-agent.lock.yml b/.github/workflows/issue-triage-agent.lock.yml index 5c8b21216a4..bb2697190aa 100644 --- a/.github/workflows/issue-triage-agent.lock.yml +++ b/.github/workflows/issue-triage-agent.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -325,12 +346,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -875,12 +917,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1008,12 +1071,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1195,12 +1279,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/jsweep.lock.yml b/.github/workflows/jsweep.lock.yml index 0be08d45857..ca17725dcab 100644 --- a/.github/workflows/jsweep.lock.yml +++ b/.github/workflows/jsweep.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -374,12 +395,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1008,12 +1050,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1149,12 +1212,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1336,12 +1420,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1451,12 +1556,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: jsweep steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/layout-spec-maintainer.lock.yml b/.github/workflows/layout-spec-maintainer.lock.yml index 19ae1b14c36..0d4a0866ebe 100644 --- a/.github/workflows/layout-spec-maintainer.lock.yml +++ b/.github/workflows/layout-spec-maintainer.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -329,12 +350,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -933,12 +975,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1074,12 +1137,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1261,12 +1345,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/lockfile-stats.lock.yml b/.github/workflows/lockfile-stats.lock.yml index e9ecdbb21a7..e3826c8bb1b 100644 --- a/.github/workflows/lockfile-stats.lock.yml +++ b/.github/workflows/lockfile-stats.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -333,12 +354,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -970,12 +1012,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1102,12 +1165,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1296,12 +1380,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1373,12 +1478,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: lockfilestats steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/mcp-inspector.lock.yml b/.github/workflows/mcp-inspector.lock.yml index 01639d381d9..f5bed860020 100644 --- a/.github/workflows/mcp-inspector.lock.yml +++ b/.github/workflows/mcp-inspector.lock.yml @@ -133,12 +133,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -428,12 +449,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1459,12 +1501,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1595,12 +1658,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2055,12 +2139,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2133,12 +2238,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: mcpinspector steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/mergefest.lock.yml b/.github/workflows/mergefest.lock.yml index 0df593e6d2c..c371665af35 100644 --- a/.github/workflows/mergefest.lock.yml +++ b/.github/workflows/mergefest.lock.yml @@ -87,12 +87,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -379,12 +400,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -966,12 +1008,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1121,12 +1184,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1285,12 +1369,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1353,12 +1458,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/metrics-collector.lock.yml b/.github/workflows/metrics-collector.lock.yml index f2af514185b..3f268c50e96 100644 --- a/.github/workflows/metrics-collector.lock.yml +++ b/.github/workflows/metrics-collector.lock.yml @@ -84,12 +84,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -328,12 +349,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -736,12 +778,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -778,12 +841,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/notion-issue-summary.lock.yml b/.github/workflows/notion-issue-summary.lock.yml index f88264b5c0e..f6db36c42d7 100644 --- a/.github/workflows/notion-issue-summary.lock.yml +++ b/.github/workflows/notion-issue-summary.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -328,12 +349,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -892,12 +934,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1026,12 +1089,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1338,12 +1422,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/org-health-report.lock.yml b/.github/workflows/org-health-report.lock.yml index d51b4df77b0..7283cc41294 100644 --- a/.github/workflows/org-health-report.lock.yml +++ b/.github/workflows/org-health-report.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -345,12 +366,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -984,12 +1026,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1120,12 +1183,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1308,12 +1392,33 @@ jobs: upload_artifact_slot_2_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_2_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1392,12 +1497,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: orghealthreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1442,12 +1568,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/pdf-summary.lock.yml b/.github/workflows/pdf-summary.lock.yml index 623e8b27942..17ce386c353 100644 --- a/.github/workflows/pdf-summary.lock.yml +++ b/.github/workflows/pdf-summary.lock.yml @@ -113,12 +113,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -425,12 +446,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1045,12 +1087,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1202,12 +1265,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1366,12 +1450,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1437,12 +1542,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1514,12 +1640,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: pdfsummary steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/plan.lock.yml b/.github/workflows/plan.lock.yml index 5fd68aee455..352125dd0a4 100644 --- a/.github/workflows/plan.lock.yml +++ b/.github/workflows/plan.lock.yml @@ -91,12 +91,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -382,12 +403,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -970,12 +1012,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1123,12 +1186,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1287,12 +1371,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1356,12 +1461,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/poem-bot.lock.yml b/.github/workflows/poem-bot.lock.yml index bcbeb4936ab..0bd0b1b310f 100644 --- a/.github/workflows/poem-bot.lock.yml +++ b/.github/workflows/poem-bot.lock.yml @@ -106,12 +106,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -415,12 +436,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1315,12 +1357,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1475,12 +1538,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1639,12 +1723,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1717,12 +1822,33 @@ jobs: upload_artifact_slot_0_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_0_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1794,12 +1920,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: poembot steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/pr-nitpick-reviewer.lock.yml b/.github/workflows/pr-nitpick-reviewer.lock.yml index f50f7d487cf..4a44865d463 100644 --- a/.github/workflows/pr-nitpick-reviewer.lock.yml +++ b/.github/workflows/pr-nitpick-reviewer.lock.yml @@ -96,12 +96,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -396,12 +417,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1034,12 +1076,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1191,12 +1254,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1355,12 +1439,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1424,12 +1529,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1501,12 +1627,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: prnitpickreviewer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/pr-triage-agent.lock.yml b/.github/workflows/pr-triage-agent.lock.yml index d771618e3ba..cd3dde86210 100644 --- a/.github/workflows/pr-triage-agent.lock.yml +++ b/.github/workflows/pr-triage-agent.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -341,12 +362,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -965,12 +1007,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1104,12 +1167,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1277,12 +1361,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1384,12 +1489,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/prompt-clustering-analysis.lock.yml b/.github/workflows/prompt-clustering-analysis.lock.yml index 909e5fc2782..4e19a36276b 100644 --- a/.github/workflows/prompt-clustering-analysis.lock.yml +++ b/.github/workflows/prompt-clustering-analysis.lock.yml @@ -111,12 +111,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -364,12 +385,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1170,12 +1212,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1302,12 +1365,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1496,12 +1580,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1575,12 +1680,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: promptclusteringanalysis steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1625,12 +1751,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/python-data-charts.lock.yml b/.github/workflows/python-data-charts.lock.yml index 202bfdecd2d..230265978cb 100644 --- a/.github/workflows/python-data-charts.lock.yml +++ b/.github/workflows/python-data-charts.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1055,12 +1097,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1191,12 +1254,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1379,12 +1463,33 @@ jobs: upload_artifact_slot_2_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_2_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1463,12 +1568,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: pythondatacharts steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1513,12 +1639,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml index a6c3bf3cac0..80689316914 100644 --- a/.github/workflows/q.lock.yml +++ b/.github/workflows/q.lock.yml @@ -124,12 +124,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -467,12 +488,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1211,12 +1253,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1368,12 +1431,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1532,12 +1616,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1605,12 +1710,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1720,12 +1846,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: q steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/refactoring-cadence.lock.yml b/.github/workflows/refactoring-cadence.lock.yml index 98c3e2dbe2c..6ceb418ee7a 100644 --- a/.github/workflows/refactoring-cadence.lock.yml +++ b/.github/workflows/refactoring-cadence.lock.yml @@ -83,12 +83,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -329,12 +350,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -914,12 +956,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1054,12 +1117,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1218,12 +1302,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1290,12 +1395,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1367,12 +1493,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: refactoringcadence steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/refiner.lock.yml b/.github/workflows/refiner.lock.yml index 99b0e644432..143f1ddeba9 100644 --- a/.github/workflows/refiner.lock.yml +++ b/.github/workflows/refiner.lock.yml @@ -102,12 +102,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -363,12 +384,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -955,12 +997,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1092,12 +1155,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1258,12 +1342,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1320,12 +1425,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 1561e239146..00775b0ee09 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -103,12 +103,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -347,12 +368,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -929,12 +971,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1159,12 +1222,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1427,12 +1511,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/repo-audit-analyzer.lock.yml b/.github/workflows/repo-audit-analyzer.lock.yml index a4662c05467..b71565a199a 100644 --- a/.github/workflows/repo-audit-analyzer.lock.yml +++ b/.github/workflows/repo-audit-analyzer.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -340,12 +361,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -920,12 +962,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1058,12 +1121,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1242,12 +1326,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1319,12 +1424,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: repoauditanalyzer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/repo-tree-map.lock.yml b/.github/workflows/repo-tree-map.lock.yml index 4ae6ebf9892..75f18c6d597 100644 --- a/.github/workflows/repo-tree-map.lock.yml +++ b/.github/workflows/repo-tree-map.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -325,12 +346,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -877,12 +919,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1013,12 +1076,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1197,12 +1281,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/repository-quality-improver.lock.yml b/.github/workflows/repository-quality-improver.lock.yml index 3ea97b51e16..b6e470b815a 100644 --- a/.github/workflows/repository-quality-improver.lock.yml +++ b/.github/workflows/repository-quality-improver.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -373,12 +394,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -984,12 +1026,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1120,12 +1183,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1304,12 +1388,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1381,12 +1486,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: repositoryqualityimprover steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/research.lock.yml b/.github/workflows/research.lock.yml index 652bd39b75d..822a310fc24 100644 --- a/.github/workflows/research.lock.yml +++ b/.github/workflows/research.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -333,12 +354,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -910,12 +952,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1046,12 +1109,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1230,12 +1314,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/safe-output-health.lock.yml b/.github/workflows/safe-output-health.lock.yml index daca4d79f4e..c16d9d3932a 100644 --- a/.github/workflows/safe-output-health.lock.yml +++ b/.github/workflows/safe-output-health.lock.yml @@ -95,12 +95,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -337,12 +358,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1056,12 +1098,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1188,12 +1251,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1382,12 +1466,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1459,12 +1564,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: safeoutputhealth steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/schema-consistency-checker.lock.yml b/.github/workflows/schema-consistency-checker.lock.yml index 0925e5e46a6..7e95a58124e 100644 --- a/.github/workflows/schema-consistency-checker.lock.yml +++ b/.github/workflows/schema-consistency-checker.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -950,12 +992,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1082,12 +1145,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1276,12 +1360,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1353,12 +1458,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: schemaconsistencychecker steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/schema-feature-coverage.lock.yml b/.github/workflows/schema-feature-coverage.lock.yml index f59e4bb6218..6f0f7b035c0 100644 --- a/.github/workflows/schema-feature-coverage.lock.yml +++ b/.github/workflows/schema-feature-coverage.lock.yml @@ -82,12 +82,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -934,12 +976,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1066,12 +1129,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1191,18 +1275,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_bb65e3bc6417a611_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_e5c0aa6def92b69b_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_bb65e3bc6417a611_EOF + GH_AW_MCP_CONFIG_e5c0aa6def92b69b_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_6c3ebb3a56d75a86_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_d704a9eb45998abf_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1213,11 +1297,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_6c3ebb3a56d75a86_EOF + GH_AW_MCP_CONFIG_d704a9eb45998abf_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_8c22856536043063_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_7bda7c5829abc3be_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1227,7 +1311,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_8c22856536043063_EOF + GH_AW_CODEX_SHELL_POLICY_7bda7c5829abc3be_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1318,12 +1402,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/scout.lock.yml b/.github/workflows/scout.lock.yml index 1a88403f545..5001be53ff6 100644 --- a/.github/workflows/scout.lock.yml +++ b/.github/workflows/scout.lock.yml @@ -146,12 +146,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -453,12 +474,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1202,12 +1244,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1353,12 +1416,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1528,12 +1612,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1598,12 +1703,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1675,12 +1801,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: scout steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/security-compliance.lock.yml b/.github/workflows/security-compliance.lock.yml index bc3c9529e02..bfcbf957f14 100644 --- a/.github/workflows/security-compliance.lock.yml +++ b/.github/workflows/security-compliance.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -349,12 +370,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -913,12 +955,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1051,12 +1114,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1224,12 +1308,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1326,12 +1431,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/security-review.lock.yml b/.github/workflows/security-review.lock.yml index 4bdf14a0240..c7501832978 100644 --- a/.github/workflows/security-review.lock.yml +++ b/.github/workflows/security-review.lock.yml @@ -97,12 +97,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -396,12 +417,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1081,12 +1123,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1236,12 +1299,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1401,12 +1485,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1468,12 +1573,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1545,12 +1671,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: securityreview steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/semantic-function-refactor.lock.yml b/.github/workflows/semantic-function-refactor.lock.yml index 091017e039a..0b1aefc9c55 100644 --- a/.github/workflows/semantic-function-refactor.lock.yml +++ b/.github/workflows/semantic-function-refactor.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -356,12 +377,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1019,12 +1061,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1149,12 +1212,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1344,12 +1428,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/sergo.lock.yml b/.github/workflows/sergo.lock.yml index ccc2c71dfa6..5e1f7a3d00d 100644 --- a/.github/workflows/sergo.lock.yml +++ b/.github/workflows/sergo.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -366,12 +387,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1067,12 +1109,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1204,12 +1267,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1401,12 +1485,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1478,12 +1583,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: sergo steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/slide-deck-maintainer.lock.yml b/.github/workflows/slide-deck-maintainer.lock.yml index 2080d7faa6c..663b44e4e07 100644 --- a/.github/workflows/slide-deck-maintainer.lock.yml +++ b/.github/workflows/slide-deck-maintainer.lock.yml @@ -96,12 +96,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -360,12 +381,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1025,12 +1067,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1166,12 +1229,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1329,12 +1413,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1401,12 +1506,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1516,12 +1642,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: slidedeckmaintainer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-agent-all-merged.lock.yml b/.github/workflows/smoke-agent-all-merged.lock.yml index c4a4d8eb795..5d72819c8bb 100644 --- a/.github/workflows/smoke-agent-all-merged.lock.yml +++ b/.github/workflows/smoke-agent-all-merged.lock.yml @@ -104,12 +104,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -970,12 +1012,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1121,12 +1184,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1298,12 +1382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1357,12 +1462,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-agent-all-none.lock.yml b/.github/workflows/smoke-agent-all-none.lock.yml index 81e04b3e3a8..4ab025866ac 100644 --- a/.github/workflows/smoke-agent-all-none.lock.yml +++ b/.github/workflows/smoke-agent-all-none.lock.yml @@ -104,12 +104,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -970,12 +1012,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1121,12 +1184,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1298,12 +1382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1357,12 +1462,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-agent-public-approved.lock.yml b/.github/workflows/smoke-agent-public-approved.lock.yml index fe443b023b3..ad5010911a7 100644 --- a/.github/workflows/smoke-agent-public-approved.lock.yml +++ b/.github/workflows/smoke-agent-public-approved.lock.yml @@ -106,12 +106,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -370,12 +391,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1019,12 +1061,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1173,12 +1236,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1350,12 +1434,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1412,12 +1517,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-agent-public-none.lock.yml b/.github/workflows/smoke-agent-public-none.lock.yml index 7595eb91064..ced84d795f5 100644 --- a/.github/workflows/smoke-agent-public-none.lock.yml +++ b/.github/workflows/smoke-agent-public-none.lock.yml @@ -104,12 +104,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -970,12 +1012,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1121,12 +1184,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1298,12 +1382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1357,12 +1462,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-agent-scoped-approved.lock.yml b/.github/workflows/smoke-agent-scoped-approved.lock.yml index 351987e982a..f6d96912978 100644 --- a/.github/workflows/smoke-agent-scoped-approved.lock.yml +++ b/.github/workflows/smoke-agent-scoped-approved.lock.yml @@ -105,12 +105,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -364,12 +385,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -977,12 +1019,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1128,12 +1191,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1305,12 +1389,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1364,12 +1469,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-call-workflow.lock.yml b/.github/workflows/smoke-call-workflow.lock.yml index c2fd4b064ef..34021f4411f 100644 --- a/.github/workflows/smoke-call-workflow.lock.yml +++ b/.github/workflows/smoke-call-workflow.lock.yml @@ -103,12 +103,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -352,12 +373,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -969,12 +1011,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1099,12 +1162,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1224,18 +1308,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_4ff7b45a797eeaa0_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_7758d1a3f0a9063d_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_4ff7b45a797eeaa0_EOF + GH_AW_MCP_CONFIG_7758d1a3f0a9063d_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_5b5766262db65e30_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_3fc00d1fc6a87b36_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1246,11 +1330,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_5b5766262db65e30_EOF + GH_AW_MCP_CONFIG_3fc00d1fc6a87b36_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_2d42e01157166183_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_b61ba7884ecdd217_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1260,7 +1344,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_2d42e01157166183_EOF + GH_AW_CODEX_SHELL_POLICY_b61ba7884ecdd217_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1332,12 +1416,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1386,12 +1491,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-ci.lock.yml b/.github/workflows/smoke-ci.lock.yml index 5844a57d7ff..4d3a884e929 100644 --- a/.github/workflows/smoke-ci.lock.yml +++ b/.github/workflows/smoke-ci.lock.yml @@ -97,12 +97,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -392,12 +413,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1185,12 +1227,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1319,12 +1382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1361,12 +1445,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1463,12 +1568,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-claude.lock.yml b/.github/workflows/smoke-claude.lock.yml index 080db54b495..ecc8ccfa833 100644 --- a/.github/workflows/smoke-claude.lock.yml +++ b/.github/workflows/smoke-claude.lock.yml @@ -122,12 +122,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -795,12 +816,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2540,12 +2582,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2694,12 +2757,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2871,12 +2955,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2937,12 +3042,33 @@ jobs: sarif_file: ${{ steps.process_safe_outputs.outputs.sarif_file }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -3046,12 +3172,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokeclaude steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-codex.lock.yml b/.github/workflows/smoke-codex.lock.yml index a309dd78f0f..515bedcc302 100644 --- a/.github/workflows/smoke-codex.lock.yml +++ b/.github/workflows/smoke-codex.lock.yml @@ -119,12 +119,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -447,12 +468,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1485,12 +1527,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1636,12 +1699,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1761,18 +1845,18 @@ jobs: DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.30' - cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_b37ab3ed5db47a6e_EOF + cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_aba6119da0cc66f6_EOF [history] persistence = "none" [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_MCP_CONFIG_b37ab3ed5db47a6e_EOF + GH_AW_MCP_CONFIG_aba6119da0cc66f6_EOF # Generate JSON config for MCP gateway GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_10da475924a40400_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_86f2da74dab4cac9_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { }, @@ -1783,11 +1867,11 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_10da475924a40400_EOF + GH_AW_MCP_CONFIG_86f2da74dab4cac9_EOF # Sync converter output to writable CODEX_HOME for Codex mkdir -p /tmp/gh-aw/mcp-config - cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_4b1c53b9eafcab1a_EOF + cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_ed309edb1ece0f1c_EOF model_provider = "openai-proxy" [model_providers.openai-proxy] name = "OpenAI AWF proxy" @@ -1797,7 +1881,7 @@ jobs: [shell_environment_policy] inherit = "core" include_only = ["CODEX_API_KEY", "HOME", "OPENAI_API_KEY", "PATH"] - GH_AW_CODEX_SHELL_POLICY_4b1c53b9eafcab1a_EOF + GH_AW_CODEX_SHELL_POLICY_ed309edb1ece0f1c_EOF awk ' BEGIN { skip_openai_proxy = 0 } /^[[:space:]]*model_provider[[:space:]]*=/ { next } @@ -1869,12 +1953,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1930,12 +2035,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2019,12 +2145,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokecodex steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-copilot-arm.lock.yml b/.github/workflows/smoke-copilot-arm.lock.yml index a53e3a2cdd8..334d9b21629 100644 --- a/.github/workflows/smoke-copilot-arm.lock.yml +++ b/.github/workflows/smoke-copilot-arm.lock.yml @@ -119,12 +119,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -452,12 +473,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1905,12 +1947,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2063,12 +2126,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2229,12 +2313,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2292,12 +2397,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2410,12 +2536,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokecopilotarm steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-copilot.lock.yml b/.github/workflows/smoke-copilot.lock.yml index 62aa8f7447c..0f5560caf99 100644 --- a/.github/workflows/smoke-copilot.lock.yml +++ b/.github/workflows/smoke-copilot.lock.yml @@ -111,12 +111,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -449,12 +470,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1971,12 +2013,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2129,12 +2192,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2293,12 +2377,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2358,12 +2463,33 @@ jobs: upload_artifact_slot_0_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_0_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -2481,12 +2607,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokecopilot steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-create-cross-repo-pr.lock.yml b/.github/workflows/smoke-create-cross-repo-pr.lock.yml index a6bd62fa7d3..d05e0dd6288 100644 --- a/.github/workflows/smoke-create-cross-repo-pr.lock.yml +++ b/.github/workflows/smoke-create-cross-repo-pr.lock.yml @@ -103,12 +103,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -372,12 +393,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1020,12 +1062,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1177,12 +1240,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1344,12 +1428,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1408,12 +1513,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-crush.lock.yml b/.github/workflows/smoke-crush.lock.yml index 99c4ea8647e..8f5b7fcb9dd 100644 --- a/.github/workflows/smoke-crush.lock.yml +++ b/.github/workflows/smoke-crush.lock.yml @@ -101,12 +101,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -372,12 +393,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1063,12 +1105,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1214,12 +1277,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1378,12 +1462,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1439,12 +1544,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-gemini.lock.yml b/.github/workflows/smoke-gemini.lock.yml index c0ef95e34ca..6123bf7213c 100644 --- a/.github/workflows/smoke-gemini.lock.yml +++ b/.github/workflows/smoke-gemini.lock.yml @@ -112,12 +112,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -398,12 +419,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1159,12 +1201,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1310,12 +1373,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1482,12 +1566,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1543,12 +1648,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1622,12 +1748,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokegemini steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-multi-pr.lock.yml b/.github/workflows/smoke-multi-pr.lock.yml index c70d9b36004..81c67dc974c 100644 --- a/.github/workflows/smoke-multi-pr.lock.yml +++ b/.github/workflows/smoke-multi-pr.lock.yml @@ -107,12 +107,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -389,12 +410,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1025,12 +1067,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1182,12 +1245,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1348,12 +1432,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1410,12 +1515,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index 40064c18133..e60b50ac59f 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -110,12 +110,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -389,12 +410,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1100,12 +1142,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1251,12 +1314,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1416,12 +1500,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1477,12 +1582,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-project.lock.yml b/.github/workflows/smoke-project.lock.yml index f32f2125acf..1e4bc78187b 100644 --- a/.github/workflows/smoke-project.lock.yml +++ b/.github/workflows/smoke-project.lock.yml @@ -108,12 +108,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -386,12 +407,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1143,12 +1185,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1300,12 +1363,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1466,12 +1550,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1530,12 +1635,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-service-ports.lock.yml b/.github/workflows/smoke-service-ports.lock.yml index dee27909362..edcc5dfca8f 100644 --- a/.github/workflows/smoke-service-ports.lock.yml +++ b/.github/workflows/smoke-service-ports.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -347,12 +368,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -901,12 +943,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1056,12 +1119,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1219,12 +1303,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1279,12 +1384,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-temporary-id.lock.yml b/.github/workflows/smoke-temporary-id.lock.yml index a7971f251c7..ffa5be4a39c 100644 --- a/.github/workflows/smoke-temporary-id.lock.yml +++ b/.github/workflows/smoke-temporary-id.lock.yml @@ -106,12 +106,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -385,12 +406,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1006,12 +1048,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1161,12 +1224,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1327,12 +1411,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1389,12 +1494,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-test-tools.lock.yml b/.github/workflows/smoke-test-tools.lock.yml index 6f5192016d0..7ff08e9a6e9 100644 --- a/.github/workflows/smoke-test-tools.lock.yml +++ b/.github/workflows/smoke-test-tools.lock.yml @@ -110,12 +110,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -371,12 +392,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -950,12 +992,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1105,12 +1168,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1271,12 +1355,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1331,12 +1436,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-update-cross-repo-pr.lock.yml b/.github/workflows/smoke-update-cross-repo-pr.lock.yml index 73a79038271..894db43f8d2 100644 --- a/.github/workflows/smoke-update-cross-repo-pr.lock.yml +++ b/.github/workflows/smoke-update-cross-repo-pr.lock.yml @@ -105,12 +105,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -381,12 +402,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1041,12 +1083,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1198,12 +1261,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1365,12 +1449,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1429,12 +1534,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1547,12 +1673,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: smokeupdatecrossrepopr steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-workflow-call-with-inputs.lock.yml b/.github/workflows/smoke-workflow-call-with-inputs.lock.yml index 35672a03cc9..3f1458219dd 100644 --- a/.github/workflows/smoke-workflow-call-with-inputs.lock.yml +++ b/.github/workflows/smoke-workflow-call-with-inputs.lock.yml @@ -102,12 +102,33 @@ jobs: target_repo_name: ${{ steps.resolve-host-repo.outputs.target_repo_name }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -378,12 +399,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -953,12 +995,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1087,12 +1150,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1250,12 +1334,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1307,12 +1412,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/smoke-workflow-call.lock.yml b/.github/workflows/smoke-workflow-call.lock.yml index 9565c77abe1..9a0a74e5027 100644 --- a/.github/workflows/smoke-workflow-call.lock.yml +++ b/.github/workflows/smoke-workflow-call.lock.yml @@ -109,12 +109,33 @@ jobs: target_repo_name: ${{ steps.resolve-host-repo.outputs.target_repo_name }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -376,12 +397,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -931,12 +973,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1066,12 +1129,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1229,12 +1313,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1289,12 +1394,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/spec-enforcer.lock.yml b/.github/workflows/spec-enforcer.lock.yml index cb9820fcc7b..af1a58a3e8e 100644 --- a/.github/workflows/spec-enforcer.lock.yml +++ b/.github/workflows/spec-enforcer.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1008,12 +1050,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1145,12 +1208,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1342,12 +1426,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1457,12 +1562,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: specenforcer steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/spec-extractor.lock.yml b/.github/workflows/spec-extractor.lock.yml index 2c4d86281bc..925fa605bcd 100644 --- a/.github/workflows/spec-extractor.lock.yml +++ b/.github/workflows/spec-extractor.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -372,12 +393,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1045,12 +1087,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1186,12 +1249,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1374,12 +1458,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1489,12 +1594,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: specextractor steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/spec-librarian.lock.yml b/.github/workflows/spec-librarian.lock.yml index c92af07f947..ed923a07982 100644 --- a/.github/workflows/spec-librarian.lock.yml +++ b/.github/workflows/spec-librarian.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -361,12 +382,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -974,12 +1016,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1116,12 +1179,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1280,12 +1364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1354,12 +1459,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/stale-repo-identifier.lock.yml b/.github/workflows/stale-repo-identifier.lock.yml index e0eec52e280..fd7f302eee8 100644 --- a/.github/workflows/stale-repo-identifier.lock.yml +++ b/.github/workflows/stale-repo-identifier.lock.yml @@ -112,12 +112,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -368,12 +389,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1125,12 +1167,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1262,12 +1325,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1455,12 +1539,33 @@ jobs: upload_artifact_slot_4_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_4_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1541,12 +1646,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: stalerepoidentifier steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1591,12 +1717,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/static-analysis-report.lock.yml b/.github/workflows/static-analysis-report.lock.yml index d87a019ac3a..6c4011a4766 100644 --- a/.github/workflows/static-analysis-report.lock.yml +++ b/.github/workflows/static-analysis-report.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -342,12 +363,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1074,12 +1116,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1204,12 +1267,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1399,12 +1483,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1476,12 +1581,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: staticanalysisreport steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/step-name-alignment.lock.yml b/.github/workflows/step-name-alignment.lock.yml index 8ffecca3390..d29ae8ed4e6 100644 --- a/.github/workflows/step-name-alignment.lock.yml +++ b/.github/workflows/step-name-alignment.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -323,12 +344,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -969,12 +1011,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1099,12 +1162,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1294,12 +1378,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1371,12 +1476,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: stepnamealignment steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/sub-issue-closer.lock.yml b/.github/workflows/sub-issue-closer.lock.yml index 08ace326ee6..c05a7f0be5f 100644 --- a/.github/workflows/sub-issue-closer.lock.yml +++ b/.github/workflows/sub-issue-closer.lock.yml @@ -84,12 +84,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -317,12 +338,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -907,12 +949,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1041,12 +1104,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1228,12 +1312,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/super-linter.lock.yml b/.github/workflows/super-linter.lock.yml index 80825d65bc7..ce247cbcc39 100644 --- a/.github/workflows/super-linter.lock.yml +++ b/.github/workflows/super-linter.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -345,12 +366,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -937,12 +979,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1071,12 +1134,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1256,12 +1340,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1394,12 +1499,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: superlinter steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/technical-doc-writer.lock.yml b/.github/workflows/technical-doc-writer.lock.yml index d0089441fa7..0e19b9d4b0d 100644 --- a/.github/workflows/technical-doc-writer.lock.yml +++ b/.github/workflows/technical-doc-writer.lock.yml @@ -92,12 +92,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -353,12 +374,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1014,12 +1056,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1155,12 +1218,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1328,12 +1412,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1437,12 +1542,33 @@ jobs: upload_artifact_slot_0_tmp_id: ${{ steps.process_safe_outputs.outputs.slot_0_tmp_id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1559,12 +1685,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: technicaldocwriter steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/terminal-stylist.lock.yml b/.github/workflows/terminal-stylist.lock.yml index c002772f3d8..30de4a34ed3 100644 --- a/.github/workflows/terminal-stylist.lock.yml +++ b/.github/workflows/terminal-stylist.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -356,12 +377,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -923,12 +965,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1059,12 +1122,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1243,12 +1327,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/test-create-pr-error-handling.lock.yml b/.github/workflows/test-create-pr-error-handling.lock.yml index 631e78f3726..389542bb557 100644 --- a/.github/workflows/test-create-pr-error-handling.lock.yml +++ b/.github/workflows/test-create-pr-error-handling.lock.yml @@ -85,12 +85,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -327,12 +348,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -979,12 +1021,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1111,12 +1174,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1307,12 +1391,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1422,12 +1527,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: testcreateprerrorhandling steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/test-dispatcher.lock.yml b/.github/workflows/test-dispatcher.lock.yml index c4e2a4b182a..46863d6c1ad 100644 --- a/.github/workflows/test-dispatcher.lock.yml +++ b/.github/workflows/test-dispatcher.lock.yml @@ -80,12 +80,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -310,12 +331,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -842,12 +884,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -976,12 +1039,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1158,12 +1242,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/test-project-url-default.lock.yml b/.github/workflows/test-project-url-default.lock.yml index 0e2c895d743..c02ac90409f 100644 --- a/.github/workflows/test-project-url-default.lock.yml +++ b/.github/workflows/test-project-url-default.lock.yml @@ -81,12 +81,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -310,12 +331,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -904,12 +946,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1038,12 +1101,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1221,12 +1305,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/test-quality-sentinel.lock.yml b/.github/workflows/test-quality-sentinel.lock.yml index 9f0face5170..5b8933cd80c 100644 --- a/.github/workflows/test-quality-sentinel.lock.yml +++ b/.github/workflows/test-quality-sentinel.lock.yml @@ -82,12 +82,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -339,12 +360,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -937,12 +979,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1072,12 +1135,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1237,12 +1321,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1297,12 +1402,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/test-workflow.lock.yml b/.github/workflows/test-workflow.lock.yml index 34d3f79b510..e5f022f53df 100644 --- a/.github/workflows/test-workflow.lock.yml +++ b/.github/workflows/test-workflow.lock.yml @@ -79,12 +79,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -295,12 +316,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/tidy.lock.yml b/.github/workflows/tidy.lock.yml index b54bf6e06c5..96dafb7a34c 100644 --- a/.github/workflows/tidy.lock.yml +++ b/.github/workflows/tidy.lock.yml @@ -107,12 +107,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -392,12 +413,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1005,12 +1047,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1161,12 +1224,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1325,12 +1409,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1396,12 +1501,33 @@ jobs: push_commit_url: ${{ steps.process_safe_outputs.outputs.push_commit_url }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/typist.lock.yml b/.github/workflows/typist.lock.yml index cb90539dcf7..c20e7c6a7da 100644 --- a/.github/workflows/typist.lock.yml +++ b/.github/workflows/typist.lock.yml @@ -91,12 +91,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -360,12 +381,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1016,12 +1058,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1148,12 +1211,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1342,12 +1426,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/ubuntu-image-analyzer.lock.yml b/.github/workflows/ubuntu-image-analyzer.lock.yml index a1bade0fc21..d7d017fd75b 100644 --- a/.github/workflows/ubuntu-image-analyzer.lock.yml +++ b/.github/workflows/ubuntu-image-analyzer.lock.yml @@ -90,12 +90,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -332,12 +353,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -911,12 +953,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1052,12 +1115,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1215,12 +1299,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1287,12 +1392,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml index 9dbf27d9807..f11843709f7 100644 --- a/.github/workflows/unbloat-docs.lock.yml +++ b/.github/workflows/unbloat-docs.lock.yml @@ -104,12 +104,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -391,12 +412,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1191,12 +1233,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1344,12 +1407,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1519,12 +1603,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1604,12 +1709,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1719,12 +1845,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: unbloatdocs steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1769,12 +1916,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/update-astro.lock.yml b/.github/workflows/update-astro.lock.yml index 187348bc6a4..50c86d74b78 100644 --- a/.github/workflows/update-astro.lock.yml +++ b/.github/workflows/update-astro.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -343,12 +364,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -954,12 +996,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1095,12 +1158,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1258,12 +1342,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1330,12 +1435,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/video-analyzer.lock.yml b/.github/workflows/video-analyzer.lock.yml index fa9a77a828f..5f58d302b11 100644 --- a/.github/workflows/video-analyzer.lock.yml +++ b/.github/workflows/video-analyzer.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -325,12 +346,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -877,12 +919,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1011,12 +1074,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1196,12 +1280,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/weekly-blog-post-writer.lock.yml b/.github/workflows/weekly-blog-post-writer.lock.yml index 3d193a8711e..af2e254e2ba 100644 --- a/.github/workflows/weekly-blog-post-writer.lock.yml +++ b/.github/workflows/weekly-blog-post-writer.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -345,12 +366,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -995,12 +1037,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1140,12 +1203,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1313,12 +1397,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1417,12 +1522,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/weekly-editors-health-check.lock.yml b/.github/workflows/weekly-editors-health-check.lock.yml index 57f7ac240a4..498545dadbb 100644 --- a/.github/workflows/weekly-editors-health-check.lock.yml +++ b/.github/workflows/weekly-editors-health-check.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -331,12 +352,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -972,12 +1014,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1113,12 +1176,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1300,12 +1384,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1414,12 +1519,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/weekly-issue-summary.lock.yml b/.github/workflows/weekly-issue-summary.lock.yml index 63c131927f6..0da93626709 100644 --- a/.github/workflows/weekly-issue-summary.lock.yml +++ b/.github/workflows/weekly-issue-summary.lock.yml @@ -93,12 +93,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -338,12 +359,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -931,12 +973,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1071,12 +1134,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1256,12 +1340,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1333,12 +1438,33 @@ jobs: GH_AW_WORKFLOW_ID_SANITIZED: weeklyissuesummary steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1383,12 +1509,33 @@ jobs: published_count: ${{ steps.upload_assets.outputs.published_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/weekly-safe-outputs-spec-review.lock.yml b/.github/workflows/weekly-safe-outputs-spec-review.lock.yml index b24abac1958..91bc1ec814b 100644 --- a/.github/workflows/weekly-safe-outputs-spec-review.lock.yml +++ b/.github/workflows/weekly-safe-outputs-spec-review.lock.yml @@ -87,12 +87,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -323,12 +344,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -877,12 +919,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1018,12 +1081,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1205,12 +1289,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index 0aae6e12b45..d94faee993d 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -88,12 +88,33 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -362,12 +383,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -969,12 +1011,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1105,12 +1168,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1270,12 +1354,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1344,12 +1449,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1420,12 +1546,33 @@ jobs: timeout-minutes: 5 steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/workflow-health-manager.lock.yml b/.github/workflows/workflow-health-manager.lock.yml index 8d15f96f814..6dc10854291 100644 --- a/.github/workflows/workflow-health-manager.lock.yml +++ b/.github/workflows/workflow-health-manager.lock.yml @@ -88,12 +88,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -340,12 +361,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -984,12 +1026,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1122,12 +1185,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1285,12 +1369,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1330,12 +1435,33 @@ jobs: validation_failed_default: ${{ steps.push_repo_memory_default.outputs.validation_failed }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1436,12 +1562,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/workflow-normalizer.lock.yml b/.github/workflows/workflow-normalizer.lock.yml index 086d592bea9..9c4564039cc 100644 --- a/.github/workflows/workflow-normalizer.lock.yml +++ b/.github/workflows/workflow-normalizer.lock.yml @@ -89,12 +89,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -326,12 +347,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -944,12 +986,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1083,12 +1146,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1269,12 +1353,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/.github/workflows/workflow-skill-extractor.lock.yml b/.github/workflows/workflow-skill-extractor.lock.yml index 573d6d8ab15..d0fa2d571cc 100644 --- a/.github/workflows/workflow-skill-extractor.lock.yml +++ b/.github/workflows/workflow-skill-extractor.lock.yml @@ -86,12 +86,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -326,12 +347,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -940,12 +982,33 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1076,12 +1139,33 @@ jobs: detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -1262,12 +1346,33 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/pkg/workflow/compiler_custom_actions_test.go b/pkg/workflow/compiler_custom_actions_test.go index 3531e1eb7cb..f49bf60d856 100644 --- a/pkg/workflow/compiler_custom_actions_test.go +++ b/pkg/workflow/compiler_custom_actions_test.go @@ -226,19 +226,19 @@ Test workflow with script mode. lockStr := string(lockContent) // Verify script mode behavior: - // 1. Checkout should use repository: github/gh-aw - if !strings.Contains(lockStr, "repository: github/gh-aw") { - t.Error("Expected 'repository: github/gh-aw' in checkout step for script mode") + // 1. Checkout should use the github/gh-aw remote URL + if !strings.Contains(lockStr, "github/gh-aw.git") { + t.Error("Expected 'github/gh-aw.git' in checkout run step for script mode") } // 2. Checkout should target path: /tmp/gh-aw/actions-source - if !strings.Contains(lockStr, "path: /tmp/gh-aw/actions-source") { - t.Error("Expected 'path: /tmp/gh-aw/actions-source' in checkout step for script mode") + if !strings.Contains(lockStr, "/tmp/gh-aw/actions-source") { + t.Error("Expected '/tmp/gh-aw/actions-source' in checkout run step for script mode") } - // 3. Checkout should use shallow clone (fetch-depth: 1) - if !strings.Contains(lockStr, "fetch-depth: 1") { - t.Error("Expected 'fetch-depth: 1' in checkout step for script mode (shallow checkout)") + // 3. Checkout should use shallow clone (--depth=1) + if !strings.Contains(lockStr, "--depth=1") { + t.Error("Expected '--depth=1' in checkout run step for script mode (shallow clone)") } // 4. Setup step should run bash script instead of using "uses:" @@ -257,9 +257,9 @@ Test workflow with script mode. t.Error("Expected script mode to NOT use 'uses: ./actions/setup' but instead run bash script directly") } - // 7. Checkout should include ref: for the version - if !strings.Contains(lockStr, "ref: 1.0.0") { - t.Error("Expected 'ref: 1.0.0' in checkout step for script mode when version is set") + // 7. Checkout should include the version ref in the git fetch command + if !strings.Contains(lockStr, "origin 1.0.0") { + t.Error("Expected 'origin 1.0.0' in git fetch command for script mode when version is set") } // 8. Setup step should include INPUT_JOB_NAME for OTLP span job name attribute @@ -343,7 +343,7 @@ func TestVersionToGitRef(t *testing.T) { } // TestCheckoutActionsFolderDevModeHasRepository verifies that the Checkout actions folder -// step in dev mode includes repository: github/gh-aw so that cross-repo callers (e.g. +// step in dev mode references github/gh-aw so that cross-repo callers (e.g. // event-driven relays) can find the actions/ directory instead of defaulting to the // caller's repo which has no actions/ directory. func TestCheckoutActionsFolderDevModeHasRepository(t *testing.T) { @@ -353,8 +353,8 @@ func TestCheckoutActionsFolderDevModeHasRepository(t *testing.T) { lines := compiler.generateCheckoutActionsFolder(nil) combined := strings.Join(lines, "") - if !strings.Contains(combined, "repository: github/gh-aw") { - t.Error("Dev mode Checkout actions folder should include 'repository: github/gh-aw' (fix for #20658)") + if !strings.Contains(combined, "github/gh-aw.git") { + t.Error("Dev mode Checkout actions folder should include 'github/gh-aw.git' remote URL (fix for #20658)") } } diff --git a/pkg/workflow/compiler_yaml_step_generation.go b/pkg/workflow/compiler_yaml_step_generation.go index d0895a25a6d..c527bc56c4e 100644 --- a/pkg/workflow/compiler_yaml_step_generation.go +++ b/pkg/workflow/compiler_yaml_step_generation.go @@ -13,6 +13,10 @@ var compilerYamlStepGenerationLog = logger.New("workflow:compiler_yaml_step_gene // when running in dev mode and not using the action-tag feature. This is used to // checkout the local actions before running the setup action. // +// The step uses a bash retry loop (3 attempts, exponential backoff: 5 s then 15 s) +// instead of actions/checkout so that transient GitHub HTTP 500 / DNS errors during +// infrastructure outages no longer cause an unrecoverable conclusion-job failure. +// // Returns a slice of strings that can be appended to a steps array, where each // string represents a line of YAML for the checkout step. Returns nil if: // - Not in dev or script mode @@ -35,42 +39,79 @@ func (c *Compiler) generateCheckoutActionsFolder(data *WorkflowData) []string { // that were added after the latest tag. ref := versionToGitRef(c.version) - // Script mode: checkout .github folder from github/gh-aw to /tmp/gh-aw/actions-source/ + // Script mode: sparse-checkout of actions/ to /tmp/gh-aw/actions-source with retry. + // Uses a bash loop (3 attempts, 5 s → 15 s backoff) to survive transient GitHub outages. if c.actionMode.IsScript() { - lines := []string{ - " - name: Checkout actions folder\n", - fmt.Sprintf(" uses: %s\n", getActionPin("actions/checkout")), - " with:\n", - " repository: github/gh-aw\n", + fetchRef := ref + if fetchRef == "" { + fetchRef = "HEAD" } - if ref != "" { - lines = append(lines, fmt.Sprintf(" ref: %s\n", ref)) - } - lines = append(lines, - " sparse-checkout: |\n", - " actions\n", - " path: /tmp/gh-aw/actions-source\n", - " fetch-depth: 1\n", - " persist-credentials: false\n", - ) - return lines + var step strings.Builder + step.WriteString(" - name: Checkout actions folder\n") + step.WriteString(" run: |\n") + step.WriteString(" set -euo pipefail\n") + step.WriteString(" max_attempts=3\n") + step.WriteString(" delay=5\n") + step.WriteString(" for attempt in $(seq 1 $max_attempts); do\n") + step.WriteString(" echo \"Attempt $attempt of $max_attempts: Checking out github/gh-aw...\"\n") + step.WriteString(" rm -rf /tmp/gh-aw/actions-source\n") + step.WriteString(" mkdir -p /tmp/gh-aw/actions-source\n") + step.WriteString(" if git -C /tmp/gh-aw/actions-source init --quiet \\\n") + step.WriteString(" && git -C /tmp/gh-aw/actions-source sparse-checkout init \\\n") + step.WriteString(" && git -C /tmp/gh-aw/actions-source sparse-checkout set actions \\\n") + step.WriteString(" && git -C /tmp/gh-aw/actions-source remote add origin https://github.com/github/gh-aw.git \\\n") + fmt.Fprintf(&step, " && git -C /tmp/gh-aw/actions-source -c \"http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}\" fetch --depth=1 --quiet origin %s \\\n", fetchRef) + step.WriteString(" && git -C /tmp/gh-aw/actions-source checkout --quiet FETCH_HEAD; then\n") + step.WriteString(" echo \"Checkout succeeded\"\n") + step.WriteString(" break\n") + step.WriteString(" fi\n") + step.WriteString(" if [ \"$attempt\" -lt \"$max_attempts\" ]; then\n") + step.WriteString(" echo \"Checkout failed. Retrying in ${delay}s...\"\n") + step.WriteString(" sleep \"$delay\"\n") + step.WriteString(" delay=$((delay * 3))\n") + step.WriteString(" else\n") + step.WriteString(" echo \"Checkout failed after $max_attempts attempts\"\n") + step.WriteString(" exit 1\n") + step.WriteString(" fi\n") + step.WriteString(" done\n") + step.WriteString(" env:\n") + step.WriteString(" GITHUB_TOKEN: ${{ github.token }}\n") + return []string{step.String()} } - // Dev mode: checkout actions folder from github/gh-aw so that cross-repo - // callers (e.g. event-driven relays) can find the actions/ directory. - // Without repository: the runner defaults to the caller's repo, which has - // no actions/ directory, causing Setup Scripts to fail immediately. + // Dev mode: sparse-checkout of actions/ to GITHUB_WORKSPACE with retry. + // Uses a bash loop (3 attempts, 5 s → 15 s backoff) to survive transient GitHub outages. if c.actionMode.IsDev() { - lines := []string{ - " - name: Checkout actions folder\n", - fmt.Sprintf(" uses: %s\n", getActionPin("actions/checkout")), - " with:\n", - " repository: github/gh-aw\n", - " sparse-checkout: |\n", - " actions\n", - " persist-credentials: false\n", - } - return lines + var step strings.Builder + step.WriteString(" - name: Checkout actions folder\n") + step.WriteString(" run: |\n") + step.WriteString(" set -euo pipefail\n") + step.WriteString(" max_attempts=3\n") + step.WriteString(" delay=5\n") + step.WriteString(" for attempt in $(seq 1 $max_attempts); do\n") + step.WriteString(" echo \"Attempt $attempt of $max_attempts: Checking out github/gh-aw...\"\n") + step.WriteString(" git remote remove origin 2>/dev/null || true\n") + step.WriteString(" if git init --quiet \\\n") + step.WriteString(" && git sparse-checkout init \\\n") + step.WriteString(" && git sparse-checkout set actions \\\n") + step.WriteString(" && git remote add origin https://github.com/github/gh-aw.git \\\n") + step.WriteString(" && git -c \"http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}\" fetch --depth=1 --quiet origin HEAD \\\n") + step.WriteString(" && git checkout --quiet FETCH_HEAD; then\n") + step.WriteString(" echo \"Checkout succeeded\"\n") + step.WriteString(" break\n") + step.WriteString(" fi\n") + step.WriteString(" if [ \"$attempt\" -lt \"$max_attempts\" ]; then\n") + step.WriteString(" echo \"Checkout failed. Retrying in ${delay}s...\"\n") + step.WriteString(" sleep \"$delay\"\n") + step.WriteString(" delay=$((delay * 3))\n") + step.WriteString(" else\n") + step.WriteString(" echo \"Checkout failed after $max_attempts attempts\"\n") + step.WriteString(" exit 1\n") + step.WriteString(" fi\n") + step.WriteString(" done\n") + step.WriteString(" env:\n") + step.WriteString(" GITHUB_TOKEN: ${{ github.token }}\n") + return []string{step.String()} } // Release mode or other modes: no checkout needed diff --git a/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden b/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden index 4216c17bfcc..6e74bd8f6f4 100644 --- a/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden +++ b/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden @@ -33,12 +33,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -255,12 +276,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -554,12 +596,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup diff --git a/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden b/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden index 9b105c18c6c..f28efda3c08 100644 --- a/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden +++ b/pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden @@ -33,12 +33,33 @@ jobs: stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -256,12 +277,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup @@ -555,12 +597,33 @@ jobs: setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Checkout actions folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: github/gh-aw - sparse-checkout: | - actions - persist-credentials: false + run: | + set -euo pipefail + max_attempts=3 + delay=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt of $max_attempts: Checking out github/gh-aw..." + git remote remove origin 2>/dev/null || true + if git init --quiet \ + && git sparse-checkout init \ + && git sparse-checkout set actions \ + && git remote add origin https://github.com/github/gh-aw.git \ + && git -c "http.extraheader=Authorization: Bearer ${GITHUB_TOKEN}" fetch --depth=1 --quiet origin HEAD \ + && git checkout --quiet FETCH_HEAD; then + echo "Checkout succeeded" + break + fi + if [ "$attempt" -lt "$max_attempts" ]; then + echo "Checkout failed. Retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 3)) + else + echo "Checkout failed after $max_attempts attempts" + exit 1 + fi + done + env: + GITHUB_TOKEN: ${{ github.token }} - name: Setup Scripts id: setup uses: ./actions/setup