Skip to content

Commit 81d911b

Browse files
committed
Ajouter le workflow temporaire d'import des images GitHub Skills
1 parent cb8544c commit 81d911b

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Importer les images GitHub Skills
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/import-github-skills-images.yml"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
import_images:
15+
name: Importer les captures historiques
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Récupérer le dépôt
19+
uses: actions/checkout@v4
20+
21+
- name: Télécharger les captures officielles historiques
22+
shell: bash
23+
run: |
24+
set -euo pipefail
25+
mkdir -p images
26+
27+
base="https://raw.githubusercontent.com/skills/introduction-to-github/b8a8d9323bd0a3950a932e8d4eedcf3e8028c5a9/images"
28+
29+
for file in create-new-repository.png create-branch-button.png main-branch-dropdown.png commit-full-screen.png compare-and-pull-request.png Pull-request-description.png Green-merge-pull-request.png delete-branch.png
30+
do
31+
echo "Téléchargement de $file"
32+
curl --fail --location --silent --show-error \
33+
"$base/$file" \
34+
--output "images/$file"
35+
done
36+
37+
for file in images/*.png; do
38+
test "$(xxd -p -l 8 "$file")" = "89504e470d0a1a0a"
39+
done
40+
41+
- name: Committer les images
42+
shell: bash
43+
run: |
44+
set -euo pipefail
45+
git config user.name "github-actions[bot]"
46+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
47+
git add images/
48+
git diff --cached --quiet && exit 0
49+
git commit -m "Ajouter les captures historiques GitHub Skills"
50+
git push

0 commit comments

Comments
 (0)