From 7053b3632d6307fcd39b5a6fdf3db161bc655fa4 Mon Sep 17 00:00:00 2001 From: Hinton Date: Thu, 31 Oct 2024 12:28:16 +0100 Subject: [PATCH] Automatically trigger wasm publish --- .github/workflows/build-wasm-internal.yml | 30 +++++++++++++++++++ ...internal.yml => publish-wasm-internal.yml} | 0 2 files changed, 30 insertions(+) rename .github/workflows/{publish-internal.yml => publish-wasm-internal.yml} (100%) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 8afcfaa2..b169a5e7 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -73,3 +73,33 @@ jobs: name: sdk-internal path: ${{ github.workspace }}/languages/js/sdk-internal/* if-no-files-found: error + + trigger-wasm-publish: + name: Trigger WASM publish + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Login to Azure - CI Subscription + uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Retrieve github PAT secrets + id: retrieve-secret-pat + uses: bitwarden/gh-actions/get-keyvault-secrets@main + with: + keyvault: "bitwarden-ci" + secrets: "github-pat-bitwarden-devops-bot-repo-scope" + + - name: Trigger WASM publish + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'bitwarden', + repo: 'sdk-internal', + workflow_id: 'publish-wasm-internal.yml', + ref: 'main', + }) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-wasm-internal.yml similarity index 100% rename from .github/workflows/publish-internal.yml rename to .github/workflows/publish-wasm-internal.yml