Create initialize-repo.yml

This commit is contained in:
Jörg Lohrer 2024-03-12 06:58:15 +01:00 committed by GitHub
parent 4b8058ea05
commit fa07b82d7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

31
.github/workflows/initialize-repo.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Initialize repo from template
on: [push]
jobs:
init:
name: Reinitialize repository
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- name: Exit for template repository
shell: bash
run: |
curl --silent -X GET \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/json" \
$GITHUB_API_URL/repos/$GITHUB_REPOSITORY \
| jq --exit-status '.is_template == false'
- uses: actions/checkout@v2
- name: Initialize
shell: bash
run: ./.init-repo.sh
env:
REPO_NAME: ${{ github.event.repository.name }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Initialized repo"