ci(deps): bump actions/checkout from 4 to 6 in the github-actions group #6
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: Bootstrap Template | |
| on: | |
| create: | |
| workflow_dispatch: | |
| push: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bootstrap: | |
| if: github.actor != 'github-actions[bot]' && (github.event_name != 'create' || github.event.ref_type == 'branch') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.repository.default_branch }} | |
| - name: Detect template placeholders | |
| id: placeholders | |
| run: | | |
| if [ -d project_name ] || grep -R -n "project_name\|python-template" . >/dev/null 2>&1; then | |
| echo "needs_bootstrap=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "needs_bootstrap=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set up Python | |
| if: steps.placeholders.outputs.needs_bootstrap == 'true' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Bootstrap repository metadata | |
| if: steps.placeholders.outputs.needs_bootstrap == 'true' | |
| run: python scripts/bootstrap_template.py --from-github | |
| env: | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_ACTOR_ID: ${{ github.actor_id }} | |
| - name: Commit bootstrap changes | |
| if: steps.placeholders.outputs.needs_bootstrap == 'true' | |
| run: | | |
| if git diff --quiet; then | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore(template): bootstrap repository metadata" | |
| git push origin HEAD:${{ github.event.repository.default_branch }} |