Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/mirror-repository.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
on:
push:
push: {}
schedule:
- cron: "0 0 * * *"

name: Mirror repository

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read

jobs:
mirror:
name: Mirror repository
runs-on: ubuntu-24.04
steps:
- uses: Corvina-R-D/corvina-github-public-actions/mirror-public-repository@v1
- id: bitbucket-auth
name: Get access token for Bitbucket
env:
BITBUCKET_CLIENT_ID: ${{ vars.BITBUCKET_CLIENT_ID }}
BITBUCKET_CLIENT_SECRET: ${{ secrets.BITBUCKET_CLIENT_SECRET }}
shell: bash
run: |
token="$(
curl \
--silent \
--fail \
--request POST \
--user "${BITBUCKET_CLIENT_ID}:${BITBUCKET_CLIENT_SECRET}" \
--header "content-type: application/x-www-form-urlencoded" \
--data "grant_type=client_credentials" \
"https://bitbucket.org/site/oauth2/access_token" \
| jq --exit-status --raw-output '.access_token'
)"
echo "::add-mask::${token}"
printf 'token=%s\n' "${token}" >> "${GITHUB_OUTPUT}"
Comment on lines +26 to +39

- uses: Corvina-R-D/corvina-github-actions/mirror-repository@v5
with:
target: https://x-token-auth:${{ secrets.BITBUCKET_ACCESS_TOKEN }}@bitbucket.org/exorint/mirror-corvina-device-sdk-node.git
target: https://x-token-auth:${{ steps.bitbucket-auth.outputs.token }}@bitbucket.org/exorint/mirror-corvina-device-sdk-node.git
Loading