From 90a9f643796aab46c6a6b0aabc7ae2954ceb7da3 Mon Sep 17 00:00:00 2001 From: Grant Morrison Date: Fri, 5 May 2023 15:33:58 +0100 Subject: [PATCH] fix: optic release action permissions (#103) --- .github/workflows/release.yml | 62 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40fcc04..672c274 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,33 +1,35 @@ - -name: release - -on: - workflow_dispatch: - inputs: - semver: - description: The semver to use - required: true - default: patch - type: choice - options: - - patch - - minor - - major - pull_request: - types: [closed] - -jobs: - release: +name: release +on: + workflow_dispatch: + inputs: + semver: + description: The semver to use + required: true + default: patch + type: choice + options: + - patch + - minor + - major + pull_request: + types: [closed] + +jobs: + release: permissions: - pull-requests: write contents: write - runs-on: ubuntu-latest - steps: - - uses: nearform-actions/optic-release-automation-action@v4 - with: - github-token: ${{ secrets.github_token }} - npm-token: ${{ secrets[format('NPM_TOKEN_{0}', github.actor)] || secrets.NPM_TOKEN }} - optic-token: ${{ secrets[format('OPTIC_TOKEN_{0}', github.actor)] || secrets.OPTIC_TOKEN }} - semver: ${{ github.event.inputs.semver }} + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: nearform-actions/optic-release-automation-action@v4 + with: + github-token: ${{ secrets.github_token }} + npm-token: >- + ${{ secrets[format('NPM_TOKEN_{0}', github.actor)] || + secrets.NPM_TOKEN }} + optic-token: >- + ${{ secrets[format('OPTIC_TOKEN_{0}', github.actor)] || + secrets.OPTIC_TOKEN }} + semver: ${{ github.event.inputs.semver }} commit-message: 'chore: release {version}' -