Skip to content

Init Remotes

Init Remotes #1

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 }}