new changes #2
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: Mirror Main Branch and Tags | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Push main branch and tags to mirror repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.BOT_EMAIL }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.BOT_EMAIL }} | |
run: | | |
git remote add mirror "https://${{ secrets.BOT_TOKEN }}@github.com/Codeinwp/themeisle-sdk-lib" | |
# Reset to a single commit with no history | |
git config --global user.email ${{ secrets.BOT_EMAIL }} | |
git config --global user.name "pirate-bot" | |
git checkout master | |
git reset --soft $(git rev-list --max-parents=0 HEAD) # Go to the first commit, keeping changes | |
git commit --amend -m "new changes" # Create a single commit | |
# Push to the mirror repo, overwriting history | |
git push mirror master --force # Push only the master branch with new history | |
git push mirror --tags --force |