Skip to content

Commit

Permalink
split the issue bot back out into separate workflows; combining them …
Browse files Browse the repository at this point in the history
…is not worth the complexity in the workflow
  • Loading branch information
mikealfare committed May 15, 2024
1 parent d1c6475 commit 2eb7cc9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
# **what?**
# - respond to user comments by updating issues from `awaiting_response` to `triage`
# - open issues in docs.getdbt.com for new changes
#
# **why?**
# - automate issue triage
# - ensure updates are reflected in user docs
#
# **when?**
# - users comment on issues
# - issues are closed with the `user docs` label
name: Issue bot
name: Docs issues

on:
issues:
types: [closed, labeled]
issue_comment:

permissions:
issues: write

jobs:
triage:
name: Update triage label
if: >-
github.event == 'issue_comment' &&
contains(github.event.issue.labels.*.name, 'awaiting_response')
uses: dbt-labs/actions/.github/workflows/swap-labels.yml@main
with:
add_label: triage
remove_label: awaiting_response
secrets: inherit

open-docs-issue:
name: Open docs issue
# We only want to run this when the PR has been merged or the label in the labeled event is `user docs`.
# Otherwise, it runs the risk of duplication of issues being created due to merge and label both
# triggering this workflow to run and neither having generating the comment before the other runs.
# This lives here instead of the shared workflow because this is where we decide if it should run or not.
if: |
github.event == 'issues' &&
github.event.issue.closed == true && (
(github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs')) ||
(github.event.action == 'labeled' && github.event.label.name == 'user docs')
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/issue_triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# **what?**
# - respond to user comments by updating issues from `awaiting_response` to `triage`
#
# **why?**
# - automate issue triage
#
# **when?**
# - users comment on issues
name: Issue triage

on:
issue_comment:

permissions:
issues: write

jobs:
triage:
name: Update triage label
if: contains(github.event.issue.labels.*.name, 'awaiting_response')
uses: dbt-labs/actions/.github/workflows/swap-labels.yml@main
with:
add_label: triage
remove_label: awaiting_response
secrets: inherit

0 comments on commit 2eb7cc9

Please sign in to comment.