Skip to content

Commit

Permalink
Update R2 GHA for preventing invalid approving (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
zihyeon08 authored Aug 24, 2024
1 parent ee02edb commit dcc2a0e
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/on-hackathon-r2-verified.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ jobs:
$invalid = ("${{ github.event.comment.body }}".StartsWith("/invalid")) ? "true" : ""
}
if( github.event.comment.user.login == github.event.issue.assignee.login){
$rightassignee = "true"
} else{
$rightassignee = "false"
}
echo "rightassignee=$rightassignee" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "issueNumber=$($result.issueNumber)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "issueType=$($result.issueType)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "githubID=$($result.githubID)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
Expand All @@ -89,7 +96,7 @@ jobs:
- name: Add a label - NOT Verified
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true')
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true' || steps.issue.outputs.rightassignee == 'false')
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -101,7 +108,7 @@ jobs:
- name: Comment to issue - NOT Verified
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true')
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true' || steps.issue.outputs.rightassignee == 'false')
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
Expand All @@ -118,7 +125,7 @@ jobs:
- name: Close issue - NOT Verified
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true')
(steps.issue.outputs.verified == 'false' || steps.issue.outputs.invalid == 'true' || steps.issue.outputs.rightassignee == 'false')
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -131,7 +138,8 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
steps.issue.outputs.inspected == 'true'
steps.issue.outputs.inspected == 'true' &&
steps.issue.outputs.rightassignee == 'true'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -145,7 +153,8 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
steps.issue.outputs.inspected == 'true'
steps.issue.outputs.inspected == 'true' &&
steps.issue.outputs.rightassignee == 'true'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
Expand All @@ -165,7 +174,8 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
steps.issue.outputs.inspected == 'true'
steps.issue.outputs.inspected == 'true' &&
steps.issue.outputs.rightassignee == 'true'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit dcc2a0e

Please sign in to comment.