Skip to content

Commit 68656a9

Browse files
author
Ben M
authored
chore: update triage workflow to exclude comments from github-actions bot (#25967)
* chore: update triage workflow to exclude comments from github-actions[bot]. Also added a fix for the problem of this workflow moving issues back to open after I comment and close an issue.
1 parent fcac397 commit 68656a9

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/triage_closed_issue_comment.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,29 @@ on:
66
ADD_TO_TRIAGE_BOARD_TOKEN:
77
required: true
88
issue_comment:
9-
types:
10-
- created
9+
types: [created]
10+
issues:
11+
types: [closed]
1112
jobs:
1213
move-to-new-issue-status:
13-
if: |
14-
!github.event.issue.pull_request &&
15-
github.event.issue.state == 'closed' &&
16-
github.event.comment.created_at != github.event.issue.closed_at &&
17-
github.event.sender.login != 'cypress-bot[bot]'
1814
runs-on: ubuntu-latest
1915
steps:
16+
- name: Make sure comment was added more than 20 seconds after issue closed
17+
run: |
18+
time_diff=$(($(date +%s -d "${{ github.event.comment.created_at }}" ) - $(date +%s -d "${{ github.event.issue.closed_at }}" )))
19+
echo 'COMMENT_ADDED_AFTER_CLOSE='$(($time_diff > 20)) >> $GITHUB_ENV
20+
2021
- name: Get project data
2122
env:
2223
GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
2324
ORGANIZATION: 'cypress-io'
2425
REPOSITORY: ${{ github.event.repository.name }}
2526
PROJECT_NUMBER: 9
2627
ISSUE_NUMBER: ${{ github.event.issue.number }}
28+
if: |
29+
github.event.sender.login != 'cypress-bot[bot]' &&
30+
env.COMMENT_ADDED_AFTER_CLOSE == '1' &&
31+
github.event.sender.login != 'github-actions[bot]'
2732
run: |
2833
gh api graphql -f query='
2934
query($org: String!, $repo: String!, $project: Int!, $issue: Int!) {

0 commit comments

Comments
 (0)