Ahmed Ali fc7320c454
Add rename script and GitPod badge (#5)
* docs: add gitpod badge

* chore: add "rename.sh" script

update README badges and package.json when spinning up template

* ci: add "create.yml" github action

automatically update README badges and package.json with new <user/repo-name> when spinning up the
template and commits "feat: initial commit"

* ci: polish "create.yml" script

Co-authored-by: Paul Razvan Berg <hello@paulrberg.com>
2022-10-04 13:21:35 +03:00

39 lines
1.2 KiB
YAML

name: "Create"
# The workflow will run only when `use this template` is used
on:
create:
jobs:
create:
# We will only run this action when the repository isn't the template repository
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template }}
permissions: "write-all"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
- name: "Update package.json"
run: ./.github/scripts/rename.sh "$GITHUB_REPOSITORY" "$GITHUB_REPOSITORY_OWNER"
- name: "Add rename summary"
run: |
echo "## Commit results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: "Update commit"
uses: "stefanzweifel/git-auto-commit-action@v4"
with:
commit_message: "feat: initial commit"
commit_options: "--amend"
push_options: "--force"
skip_fetch: true
- name: "Add commit summary"
run: |
echo "## Commit results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY