Create initialize-repo.yml
This commit is contained in:
parent
4b8058ea05
commit
fa07b82d7b
31
.github/workflows/initialize-repo.yml
vendored
Normal file
31
.github/workflows/initialize-repo.yml
vendored
Normal 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"
|
Loading…
Reference in a new issue