Skip to content

setup repo

setup repo #36

Workflow file for this run

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.js
sed -i -e "s/.*npm_user.*/\t\"npm_user\": \"${{ github.repository_owner }}\",/" scripts/rebrand.config.js
sed -i -e "s/.*repo.*/\t\"repo\": \"${{ github.event.repository.name }}\",/" scripts/rebrand.config.js
sed -i -e "s/.*packageName.*/\t\"packageName\": \"${{ github.event.repository.name }}\",/" scripts/rebrand.config.js
- 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