From 734b95c2d50c388b90543891df372db619c8e722 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Mon, 2 Sep 2024 14:27:46 +0300 Subject: [PATCH 1/3] Added trigger dependent repo update workflow --- .../trigger-dependent-repo-update.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/trigger-dependent-repo-update.yml diff --git a/.github/workflows/trigger-dependent-repo-update.yml b/.github/workflows/trigger-dependent-repo-update.yml new file mode 100644 index 000000000000..7c32faaf8bf9 --- /dev/null +++ b/.github/workflows/trigger-dependent-repo-update.yml @@ -0,0 +1,26 @@ +name: Trigger Dependent Repo Update Workflow + +on: + workflow_dispatch: + push: + branches: [ master ] + +jobs: + trigger: + runs-on: ubuntu-latest + steps: + - name: Generate authentication token + id: gen-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.CVAT_BOT_APP_ID }} + private-key: ${{ secrets.CVAT_BOT_PRIVATE_KEY }} + repositories: ${{ secrets.CVAT_DEPENDENT_REPO }} + + - name: Trigger repository dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ steps.gen-token.outputs.token }} + repository: cvat-ai/${{ secrets.CVAT_DEPENDENT_REPO }} + event-type: dependency_updated + client-payload: '{"triggered_by": "${{ github.repository }}", "commit_sha": "${{ github.sha }}", "branch": "${{ github.ref }}"}' From 7b3905f29a94f818c6778c9a1a35427c2d8705d0 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Mon, 9 Sep 2024 13:15:04 +0300 Subject: [PATCH 2/3] Apply comments --- .../trigger-dependent-repo-update.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/trigger-dependent-repo-update.yml b/.github/workflows/trigger-dependent-repo-update.yml index 7c32faaf8bf9..667d77462d61 100644 --- a/.github/workflows/trigger-dependent-repo-update.yml +++ b/.github/workflows/trigger-dependent-repo-update.yml @@ -1,4 +1,4 @@ -name: Trigger Dependent Repo Update Workflow +name: Trigger dependent repo update workflow on: workflow_dispatch: @@ -17,10 +17,13 @@ jobs: private-key: ${{ secrets.CVAT_BOT_PRIVATE_KEY }} repositories: ${{ secrets.CVAT_DEPENDENT_REPO }} - - name: Trigger repository dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ steps.gen-token.outputs.token }} - repository: cvat-ai/${{ secrets.CVAT_DEPENDENT_REPO }} - event-type: dependency_updated - client-payload: '{"triggered_by": "${{ github.repository }}", "commit_sha": "${{ github.sha }}", "branch": "${{ github.ref }}"}' + - name: Trigger private repository workflow + env: + GH_TOKEN: "${{ steps.gen-token.outputs.token }}" + run: | + gh workflow run \ + update-dependency.yml \ + --repo=cvat-ai/${{ secrets.CVAT_DEPENDENT_REPO }} \ + -f triggeredBy=${{ github.repository }} \ + -f commitSha=${{ github.sha }} \ + -f branch=${{ github.ref }} From 8f271b3a839881359ff790df54aca7ded1c53cce Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Tue, 10 Sep 2024 13:25:46 +0300 Subject: [PATCH 3/3] Use GH_REPO env variable instead of --repo argument --- .github/workflows/trigger-dependent-repo-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-dependent-repo-update.yml b/.github/workflows/trigger-dependent-repo-update.yml index 667d77462d61..c1d5819db52c 100644 --- a/.github/workflows/trigger-dependent-repo-update.yml +++ b/.github/workflows/trigger-dependent-repo-update.yml @@ -20,10 +20,10 @@ jobs: - name: Trigger private repository workflow env: GH_TOKEN: "${{ steps.gen-token.outputs.token }}" + GH_REPO: cvat-ai/${{ secrets.CVAT_DEPENDENT_REPO }} run: | gh workflow run \ update-dependency.yml \ - --repo=cvat-ai/${{ secrets.CVAT_DEPENDENT_REPO }} \ -f triggeredBy=${{ github.repository }} \ -f commitSha=${{ github.sha }} \ -f branch=${{ github.ref }}