setup repo #43
Workflow file for this run
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: setup repo | |
on: | |
create: | |
workflow_dispatch: | |
jobs: | |
setup: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Git | |
run: | | |
git config --global user.name "Mayank Chaudhari<https://mayank-chaudhari.vercel.app>" | |
git config --global user.email "[email protected]" | |
git fetch | |
git checkout main | |
- name: Set up repo | |
run: | | |
sed -i -e "s/rebrand/postinstall/" package.json | |
sed -i -e "s/.*owner.*/\t\"owner\": \"${{ github.repository_owner }}\",/" ./scripts/rebrand.config.json | |
sed -i -e "s/.*npm_user.*/\t\"npm_user\": \"${{ github.repository_owner }}\",/" ./scripts/rebrand.config.json | |
sed -i -e "s/.*repo.*/\t\"repo\": \"${{ github.event.repository.name }}\",/" ./scripts/rebrand.config.json | |
sed -i -e "s/.*packageName.*/\t\"packageName\": \"${{ github.event.repository.name }}\"/" ./scripts/rebrand.config.json | |
git rm .tkb | |
rm -rf ./docs | |
- name: Push changes back to repo | |
run: | | |
git add . | |
git commit -m 'Craete rebrand config 💖 <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a> [skip ci]' | |
git push origin main |