create.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Create
  2. # The workflow will run only when `use this template` is used
  3. on:
  4. create:
  5. jobs:
  6. create:
  7. # We will only run this action when the repository isn't the template repository
  8. # Reference https://docs.github.com/en/actions/learn-github-actions/contexts
  9. # Reference https://docs.github.com/en/actions/learn-github-actions/expressions
  10. if: ${{ !github.event.repository.is_template }}
  11. runs-on: ubuntu-latest
  12. permissions: write-all
  13. steps:
  14. - name: "Check out the repo"
  15. uses: "actions/checkout@v3"
  16. - name: "Update package.json"
  17. env:
  18. REPOSITORY: ${{ github.repository }}
  19. REPOSITORY_OWNER: ${{ github.repository_owner }}
  20. run: ./.github/scripts/rename.sh "$REPOSITORY" "$REPOSITORY_OWNER"
  21. - name: "Add rename summary"
  22. run: |
  23. echo "## Commit results" >> $GITHUB_STEP_SUMMARY
  24. echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
  25. - name: "Update commit"
  26. uses: stefanzweifel/git-auto-commit-action@v4
  27. with:
  28. commit_message: "feat: initial commit"
  29. commit_options: "--amend"
  30. push_options: "--force"
  31. skip_fetch: true
  32. - name: "Add commit summary"
  33. run: |
  34. echo "## Commit results" >> $GITHUB_STEP_SUMMARY
  35. echo "✅ Passed" >> $GITHUB_STEP_SUMMARY