Create #1
This file contains 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: "Create" | |
# The workflow will run only when the "Use this template" button is used | |
on: | |
create: | |
jobs: | |
create: | |
# We only run this action when the repository isn't the template repository. References: | |
# - https://docs.github.com/en/actions/learn-github-actions/contexts | |
# - 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" | |
env: | |
GITHUB_REPOSITORY_DESCRIPTION: ${{ github.event.repository.description }} | |
run: | |
./.github/scripts/setup-packagejson.sh "$GITHUB_REPOSITORY" "$GITHUB_REPOSITORY_OWNER" | |
"$GITHUB_REPOSITORY_DESCRIPTION" | |
- name: "Add rename summary" | |
run: | | |
echo "## Commit result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
- name: "Remove files not needed in the user's copy of the template" | |
run: | | |
rm -f "./.github/FUNDING.yml" | |
rm -f "./.github/scripts/setup-packagejson.sh" | |
rm -f "./.github/workflows/setup-template.yml" | |
- name: "Add remove summary" | |
run: | | |
echo "## Remove result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
- name: "Update commit" | |
uses: "stefanzweifel/git-auto-commit-action@v4" | |
with: | |
commit_message: "🎉 initialize the project using @0x90d2b2b7fb7599eebb6e7a32980857d8 template" | |
commit_options: "--amend" | |
push_options: "--force" | |
skip_fetch: true | |
- name: "Add commit summary" | |
run: | | |
echo "## Commit result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |