From 48da763d72d55afd9d7b9c52bd8bde311ad6f835 Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Sun, 9 Aug 2026 13:21:58 -0400 Subject: [PATCH 1/4] Fix Step 1 workflow activation Remove redundant workflow disable commands that fail when the exercise toolkit has already disabled those workflows. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d523f2fa-5ffe-4981-846a-3627b824bae9 --- .github/workflows/0-start-exercise.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index 34621f2..ee8d212 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -61,12 +61,7 @@ jobs: issue-number: ${{ env.ISSUE_NUMBER }} file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - - name: Reset exercise workflows and enable Step 1 - run: | - gh workflow disable "Step 1" - gh workflow disable "Step 2" - gh workflow disable "Step 3" - gh workflow disable "${{ github.workflow }}" - gh workflow enable "Step 1" + - name: Enable Step 1 + run: gh workflow enable "Step 1" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a2337e852e4666dd8f52e54da0f37dfe297ee265 Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Sun, 9 Aug 2026 13:23:22 -0400 Subject: [PATCH 2/4] Make exercise workflow reset idempotent Use the Actions API with workflow filenames so Steps 2 and 3 are disabled regardless of their current state before Step 1 is enabled. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d523f2fa-5ffe-4981-846a-3627b824bae9 --- .github/workflows/0-start-exercise.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index ee8d212..668d38b 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -61,7 +61,10 @@ jobs: issue-number: ${{ env.ISSUE_NUMBER }} file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - - name: Enable Step 1 - run: gh workflow enable "Step 1" + - name: Reset exercise workflows and enable Step 1 + run: | + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-last-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/enable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1341ad4ce26549e7a00bb48cc7aa17a5ff8984ac Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Sun, 9 Aug 2026 13:25:49 -0400 Subject: [PATCH 3/4] Disable Step 0 after exercise setup Use the workflow file name so Step 0 is disabled idempotently after enabling Step 1. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d523f2fa-5ffe-4981-846a-3627b824bae9 --- .github/workflows/0-start-exercise.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index 668d38b..b4a2a25 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -66,5 +66,6 @@ jobs: gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/disable" gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-last-step.yml/disable" gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/enable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/disable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 18fc404d53758817c489270a8307df03c67715d9 Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Sun, 9 Aug 2026 13:27:07 -0400 Subject: [PATCH 4/4] Use workflow client for exercise reset Select workflows by filename so disabled workflows resolve reliably while retaining the gh workflow client commands. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d523f2fa-5ffe-4981-846a-3627b824bae9 --- .github/workflows/0-start-exercise.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index b4a2a25..05ef38d 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -63,9 +63,9 @@ jobs: - name: Reset exercise workflows and enable Step 1 run: | - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-last-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/enable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/disable" + gh workflow disable "2-step.yml" + gh workflow disable "3-last-step.yml" + gh workflow enable "1-step.yml" + gh workflow disable "0-start-exercise.yml" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}