Skip to content

Commit 8e02089

Browse files
committed
fixed the authorization condition
1 parent b384cfc commit 8e02089

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

.github/workflows/terraform-apply.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@ jobs:
1010
terraform:
1111
name: 'Terraform Apply'
1212
runs-on: self-hosted
13-
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, '/test') || contains(github.event.comment.body, '/rc_test')) }}
14-
13+
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, '/test') || contains(github.event.comment.body, '/rc_test')) && contains(fromJson('["OWNER","MEMBER"]'), github.event.comment.author_association) }}
14+
1515
steps:
16-
- name: Check User Access
17-
if: ${{ github.event.comment.author_association != 'OWNER' && github.event.comment.author_association != 'COLLABORATOR' }}
18-
run: |
19-
echo "User ${{ github.event.comment.user.login }} is not authorized to trigger this workflow."
20-
echo "User: ${{ github.event.comment.user.login }}"
21-
echo "Association: ${{ github.event.comment.author_association }}"
22-
exit 1
23-
2416
- name: Checkout
2517
uses: actions/checkout@v3
2618

0 commit comments

Comments
 (0)