Skip to content

Commit

Permalink
Add check membership
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi96 committed Aug 22, 2023
1 parent dd82d42 commit f899a54
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,32 @@ on:
types: [ created ]

jobs:
get-user-membership:

runs-on: ubuntu-latest

outputs:
isMember: ${{ steps.checkUserMember.outputs.isMember }}

steps:
- name: Check user membership
id: checkUserMember
uses: tspascoal/get-user-teams-membership@v2
with:
GITHUB_TOKEN: ${{ github.token }}
username: ${{ github.event.comment.user.login }}
team: MyTestTeam

comment-driven-automation:
if: |
github.event.issue.pull_request &&
(
startsWith(github.event.comment.body, '/spotless') ||
startsWith(github.event.comment.body, '/help')
) &&
(
github.event.comment.user.login == github.event.issue.user.login ||
needs.get-user-membership.outputs.isMember == 'true'
)
runs-on: ubuntu-latest
Expand Down

0 comments on commit f899a54

Please sign in to comment.