ci: fix trezor-common sync gh worfklow

pull/4153/head
vdovhanych 2 weeks ago committed by matejcik
parent b9a104d2ac
commit aa47f951ec

@ -12,9 +12,9 @@ jobs:
sync-common:
runs-on: ubuntu-latest
env:
GITHUB_BOT_USERNAME: ${{ secrets.TREZOR_BOT_USERNAME }}
GITHUB_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GITHUB_BOT_EMAIL: ${{ secrets.TREZOR_BOT_EMAIL }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN_COMMON_FINE }}
BOT_USERNAME: ${{ secrets.TREZOR_BOT_USERNAME }}
BOT_EMAIL: ${{ secrets.TREZOR_BOT_EMAIL }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
@ -23,20 +23,21 @@ jobs:
- name: Copy git-filter and script to temporary directory
run: |
cp ./ci/common_sync/git-filter-repo/git-filter-repo ${{runner.temp}}/common_repo_sync.sh
cp ./ci/common_sync/git-filter-repo/git-filter-repo ${{runner.temp}}/git-filter-repo
cp ./ci/common_sync/common_repo_sync.sh ${{runner.temp}}/common_repo_sync.sh
cp ./ci/common_sync/git-filter-repo ${{runner.temp}}/git-filter-repo
- name: Add git-filter-repo to PATH
- name: Confiugre git user
run: |
echo "Adding git-filter-repo to PATH"
echo '${{ runner.temp }}/ci/common_sync/git-filter-repo' >> $GITHUB_PATH
git config --global user.name "${BOT_USERNAME}"
git config --global user.email "${BOT_EMAIL}"
- name: Configure git user
- name: Add git-filter-repo to PATH
run: |
git config --global user.name $GITHUB_BOT_USERNAME
git config --global user.email $GITHUB_BOT_EMAIL
echo "Adding git-filter-repo to PATH"
echo '${{runner.temp}}' >> $GITHUB_PATH
- name: Sync trezor-common repository
run: |
echo "Synchronizing common with the trezor-common repository"
.${{ runner.temp }}/common_repo_sync.sh
git config --unset-all http.https://github.com/.extraheader
${{ runner.temp }}/common_repo_sync.sh

@ -1,13 +1,13 @@
#!/usr/bin/env bash
GH_USER="$GITHUB_BOT_USERNAME"
GH_TOKEN="$GITHUB_BOT_TOKEN"
COMMON_REPO_TOKEN="$BOT_TOKEN"
COMMON_REPO_USER="$BOT_USERNAME"
# checkout to temporary branch
git checkout -B tmp
# setup trezor-common remote
git remote add sync-common https://$GH_USER:$GH_TOKEN@github.com/trezor/trezor-common.git 2>/dev/null
git remote add sync-common https://$COMMON_REPO_USER:$COMMON_REPO_TOKEN@github.com/trezor/trezor-common.git 2>/dev/null
# top commit in HEAD before monorepo was introduced
TOP_COMMIT_IN_COMMON=893fd219d4a01bcffa0cd9cfa631856371ec5aa9

Loading…
Cancel
Save