Skip to content

Commit

Permalink
chore(ci): fix comment author validation (vectordotdev#17794)
Browse files Browse the repository at this point in the history
The PR comment author membership was being detected but that wasn't
being used to validate if the workflow(s) should proceed.
  • Loading branch information
neuronull authored Jun 29, 2023
1 parent 062224b commit 75ae967
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/comment-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ jobs:
|| contains(github.event.comment.body, '/ci-run-regression')
)
steps:
- name: Validate issue comment
- name: Get PR comment author
id: comment
uses: tspascoal/get-user-teams-membership@v2
with:
username: ${{ github.actor }}
team: 'Vector'
GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }}

- name: Validate author membership
if: steps.comment.outputs.isTeamMember == 'false'
run: exit 1

cli:
needs: validate
if: contains(github.event.comment.body, '/ci-run-all') || contains(github.event.comment.body, '/ci-run-cli')
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ jobs:
needs: cross-linux
if: needs.cross-linux.result == 'success' && github.event_name == 'issue_comment'
steps:
- name: Validate issue comment
uses: tspascoal/get-user-teams-membership@v2
with:
username: ${{ github.actor }}
team: 'Vector'
GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }}

- name: (PR comment) Get PR branch
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/integration-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/ci-run-integration') || contains(github.event.comment.body, '/ci-run-all')
steps:
- name: Validate issue comment
if: github.event_name == 'issue_comment'
- name: Get PR comment author
id: comment
uses: tspascoal/get-user-teams-membership@v2
with:
username: ${{ github.actor }}
team: 'Vector'
GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }}

- name: Validate author membership
if: steps.comment.outputs.isTeamMember == 'false'
run: exit 1

- name: (PR comment) Get PR branch
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/unit_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ jobs:
test-windows:
runs-on: [windows, windows-2019-8core]
steps:
- name: Validate issue comment
if: github.event_name == 'issue_comment'
uses: tspascoal/get-user-teams-membership@v2
with:
username: ${{ github.actor }}
team: 'Vector'
GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }}

- name: (PR comment) Get PR branch
if: ${{ github.event_name == 'issue_comment' }}
uses: xt0rted/pull-request-comment-branch@v2
Expand Down

0 comments on commit 75ae967

Please sign in to comment.