Ajouter le workflow temporaire d'import des images GitHub Skills #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Importer les images GitHub Skills | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/import-github-skills-images.yml" | |
| permissions: | |
| contents: write | |
| jobs: | |
| import_images: | |
| name: Importer les captures historiques | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Récupérer le dépôt | |
| uses: actions/checkout@v4 | |
| - name: Télécharger les captures officielles historiques | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p images | |
| base="https://raw.githubusercontent.com/skills/introduction-to-github/b8a8d9323bd0a3950a932e8d4eedcf3e8028c5a9/images" | |
| 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 | |
| do | |
| echo "Téléchargement de $file" | |
| curl --fail --location --silent --show-error \ | |
| "$base/$file" \ | |
| --output "images/$file" | |
| done | |
| for file in images/*.png; do | |
| test "$(xxd -p -l 8 "$file")" = "89504e470d0a1a0a" | |
| done | |
| - name: Committer les images | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add images/ | |
| git diff --cached --quiet && exit 0 | |
| git commit -m "Ajouter les captures historiques GitHub Skills" | |
| git push |