initial commit #28
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: Rename the project from template | |
on: [push] | |
jobs: | |
rename-project: | |
if: ${{ github.repository != 'fifthtry/fastn-template' && github.run_number == 1 }} | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# this fetches all history so that we can read each commit | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
shell: bash | |
- run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
shell: bash | |
- name: Rename the project | |
run: | | |
echo "Using '${{ env.REPOSITORY_NAME }}' and "${{ env.REPOSITORY_OWNER }}" to rename fastn package" | |
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' FASTN.ftd | |
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' FASTN/ds.ftd | |
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' index.ftd | |
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' sidebar.ftd | |
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' README.md | |
rm .github/workflows/rename.yml | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "✅ Ready to clone and code." | |
# commit_options: '--amend --no-edit' | |
push_options: --force | |
call-deploy-workflow: | |
permissions: write-all | |
needs: [ rename-project ] | |
uses: ./.github/workflows/deploy.yml |