1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

ci: fix trezor-common sync gh worfklow

This commit is contained in:
vdovhanych 2024-09-06 09:24:04 +02:00 committed by matejcik
parent b9a104d2ac
commit aa47f951ec
2 changed files with 16 additions and 15 deletions

View File

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

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
GH_USER="$GITHUB_BOT_USERNAME" COMMON_REPO_TOKEN="$BOT_TOKEN"
GH_TOKEN="$GITHUB_BOT_TOKEN" COMMON_REPO_USER="$BOT_USERNAME"
# checkout to temporary branch # checkout to temporary branch
git checkout -B tmp git checkout -B tmp
# setup trezor-common remote # 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 HEAD before monorepo was introduced
TOP_COMMIT_IN_COMMON=893fd219d4a01bcffa0cd9cfa631856371ec5aa9 TOP_COMMIT_IN_COMMON=893fd219d4a01bcffa0cd9cfa631856371ec5aa9