Skip to content

Commit a422df8

Browse files
committed
Préparer le dernier test complet Git et VS Code
1 parent a23deaf commit a422df8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Préparer le dernier test Git et VS Code
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/reset-final-test.yml"
9+
10+
permissions:
11+
actions: write
12+
contents: write
13+
14+
jobs:
15+
reset:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Réinitialiser la machine à états
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
set -euo pipefail
23+
24+
gh api --method DELETE "repos/${GITHUB_REPOSITORY}/git/refs/heads/feature/robot-status" || true
25+
26+
for workflow in 1-clone-and-branch.yml 2-working-tree-staging-commit.yml 3-history-restore-vscode.yml 4-remotes-and-pull-request.yml 5-review-merge.yml; do
27+
state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/$workflow" --jq '.state' 2>/dev/null || true)"
28+
if [ "$state" = "active" ]; then
29+
gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/$workflow/disable"
30+
fi
31+
done
32+
33+
step0="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml" --jq '.state' 2>/dev/null || true)"
34+
if [ "$step0" != "active" ]; then
35+
gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/enable"
36+
fi

0 commit comments

Comments
 (0)