Skip to content

Commit cb6ef2a

Browse files
chore: adjust release workflow conditions (#2139)
- adjust job `if` conditions - change `release` user to [Stream CI Bot](https://github.com/stream-ci-bot)
1 parent 160a57a commit cb6ef2a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
default: false
88
type: boolean
99
dry_run:
10-
description: Run package release in "dry run" mode (does not publish)
10+
description: Run package release in "dry run" mode (does not publish either)
1111
default: false
1212
type: boolean
1313
docs_env:
@@ -24,7 +24,7 @@ jobs:
2424
name: Release from "${{ github.ref_name }}" branch
2525
runs-on: ubuntu-latest
2626
# GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure
27-
if: ${{ inputs.docs_only == 'false' || github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'release-v9' }}
27+
if: ${{ !inputs.docs_only && (github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'release-v9') }}
2828
env:
2929
NODE_OPTIONS: --max_old_space_size=4096
3030
steps:
@@ -43,15 +43,17 @@ jobs:
4343
- name: Release
4444
env:
4545
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
# https://github.com/stream-ci-bot
47+
GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
4748
run: >
4849
yarn semantic-release
4950
${{ inputs.dry_run && '--dry-run' || '' }}
5051
5152
docs_release:
5253
name: Publish documentation from "${{ github.ref_name }}" branch to ${{ inputs.docs_env }}
5354
runs-on: ubuntu-latest
54-
if: ${{ inputs.dry_run == 'false' }}
55+
# skip during dry runs, release to production only from master, release to staging from anywhere
56+
if: ${{ !inputs.dry_run && ((inputs.docs_env == 'production' && github.ref_name == 'master') || (github.ref_name != 'master' && inputs.docs_env == 'staging')) }}
5557
outputs:
5658
target-version: $${{ steps.target-version.outputs }}
5759
steps:

0 commit comments

Comments
 (0)