Skip to content

Commit cdafbdf

Browse files
authored
chore(ops): fix major release perm check syntax (#2536)
1 parent 075307e commit cdafbdf

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
- main
2727

2828
env:
29-
RELEASE_TYPE: ${{ github.event.inputs.release_type }}
29+
RELEASE_TYPE: ${{ github.event.inputs.release_type || 'prerelease' }}
3030
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
3131

3232
concurrency:
@@ -69,13 +69,19 @@ jobs:
6969
echo "user-permission = ${{ steps.check_user_permission.outputs.user-permission }}"
7070
echo "require-result = ${{ steps.check_user_permission.outputs.require-result }}"
7171
72-
- name: Major release Permission Check
73-
if: ${{ env.RELEASE_TYPE == 'major' }}
74-
run: |
75-
if [ "${{ steps.check_user_permission.outputs.require-result }}" != 'true' ] || ! ${{ fromJson(env.SDK_PUBLISH_MAJOR_VERSION_ACTORS) }}.includes("${{ github.triggering_actor }}"); then
76-
echo "User does not have permission to perform a major release."
77-
exit 1
78-
fi
72+
- name: Admin Permission Check
73+
if: ${{ steps.check_user_permission.outputs.require-result != 'true' }}
74+
run: exit 1
75+
76+
- name: Allowed Actors Check
77+
id: allowed_actors_check
78+
# only allow certain SDK team members to run this workflow
79+
if: ${{ contains(fromJson(env.SDK_PUBLISH_MAJOR_VERSION_ACTORS), github.triggering_actor) }}
80+
run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT
81+
82+
- name: Allowed Actors Filter
83+
if: ${{ steps.allowed_actors_check.outputs.ALLOWED_ACTOR != 'true' }}
84+
run: exit 1
7985

8086
- name: Checkout
8187
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

0 commit comments

Comments
 (0)