From 7a31e72ecf8fa0b365e179d503920911d6cc34c9 Mon Sep 17 00:00:00 2001 From: Emmanuel-Develops Date: Tue, 13 Aug 2024 22:58:17 +0100 Subject: [PATCH] fix: add permissions and conditional for event type release to workflow --- .github/workflows/build-and-release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index d0d4dab..37b22c9 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -5,6 +5,9 @@ on: types: [created] workflow_dispatch: +permissions: + contents: write + jobs: build-and-commit: runs-on: ubuntu-latest @@ -12,6 +15,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: true - name: Setup Node.js uses: actions/setup-node@v4 @@ -35,5 +39,8 @@ jobs: git push - name: Update release with dist folder + if: github.event_name == 'release' + env: + BDP_UI_TOKEN: ${{ secrets.BDP_UI_TOKEN }} run: | gh release upload ${{ github.ref }} dist/** --clobber \ No newline at end of file