Last active
February 28, 2023 16:53
-
-
Save joshuapliatrio/d7a06bcef4e24120cb8e6607d66507c8 to your computer and use it in GitHub Desktop.
An example of initializing a lab repo
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: Initialize repo | |
| permissions: | |
| contents: write | |
| on: | |
| create: | |
| jobs: | |
| initialize-repo: | |
| if: github.event.repository.name != 'dojo-github-lab' | |
| runs-on: ubuntu-latest | |
| name: Initialize lab repo | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Update template files with new repo name | |
| run: | | |
| find ./ -type f -not -path "./.github/workflows/*" -exec sed -i -e 's/dojo-github-lab/${{github.event.repository.name}}/g' {} \; | |
| - name: Commit updated files | |
| run: | | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| git config --global user.name "${{ github.actor }}" | |
| git add . | |
| git commit -m "Initializing new repo" | |
| git tag v1.0.0 | |
| git push --atomic origin ${{ github.ref_name }} v1.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment