From dd72900db1ccd4d9ff2399247f8e08aeac3774fa Mon Sep 17 00:00:00 2001 From: fireblocks_dx_team Date: Sun, 2 Aug 2026 14:00:55 +0000 Subject: [PATCH] Generated CLI #2725186467 --- .../workflows/publish-release-on-pr-merge.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-release-on-pr-merge.yml b/.github/workflows/publish-release-on-pr-merge.yml index 324b8a6..46b1881 100644 --- a/.github/workflows/publish-release-on-pr-merge.yml +++ b/.github/workflows/publish-release-on-pr-merge.yml @@ -6,16 +6,27 @@ on: branches: [main] permissions: - contents: write - pull-requests: read + contents: read jobs: publish-release: runs-on: ubuntu-latest if: >- github.event.pull_request.merged == true && + github.event.pull_request.head.repo.full_name == github.repository && + github.event.pull_request.user.login == 'cli-generation-automation[bot]' && startsWith(github.event.pull_request.head.ref, 'fireblocks-cli/generated/') steps: + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.CLI_GENERATION_APP_ID }} + private-key: ${{ secrets.CLI_GENERATION_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + - name: Check for existing release id: existing env: @@ -26,6 +37,7 @@ jobs: GH_REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} run: | + set -o pipefail marker="" existing_url=$(gh release list --limit 20 --json tagName,url \ --jq '.[].tagName' | while read -r tag; do @@ -83,7 +95,7 @@ jobs: - name: Create published release if: steps.existing.outputs.skip == 'false' env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} GH_REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} PR_BODY: ${{ github.event.pull_request.body }}