Init Remotes #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: Initialize Bitbucket mirror | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync_to_bitbucket: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Extract repository name | |
id: extract_repo_name | |
run: echo "::set-output name=reponame::$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)" | |
- name: Set up Git | |
run: | | |
git config --global user.email "${{ secrets.BITBUCKET_EMAIL }}" | |
env: | |
BITBUCKET_EMAIL: ${{ secrets.BITBUCKET_EMAIL }} | |
- name: Remove shallow update | |
run: git fetch --prune --unshallow | |
- name: Push to Bitbucket | |
run: | | |
git remote add bitbucket https://x-token-auth:${{ secrets.BITBUCKET_TOKEN }}@bitbucket.org/rmottalabs/${{ steps.extract_repo_name.outputs.reponame }}.git | |
git push --set-upstream bitbucket --all | |
git push --set-upstream bitbucket --tags | |
env: | |
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }} |