diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml new file mode 100644 index 00000000..aa627967 --- /dev/null +++ b/.github/workflows/docs-issues.yml @@ -0,0 +1,35 @@ +# **what?** +# - open issues in docs.getdbt.com for new changes +# +# **why?** +# - ensure updates are reflected in user docs +# +# **when?** +# - issues are closed with the `user docs` label +name: Docs issues + +on: + issues: + types: [closed, labeled] + +permissions: + issues: write + +jobs: + 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.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') + ) + uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main + with: + issue_repository: "dbt-labs/docs.getdbt.com" + issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} PR #${{ github.event.pull_request.number }}" + issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." + secrets: inherit diff --git a/.github/workflows/issue_triage.yml b/.github/workflows/issue_triage.yml new file mode 100644 index 00000000..eb5ba417 --- /dev/null +++ b/.github/workflows/issue_triage.yml @@ -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 diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml deleted file mode 100644 index c693eb48..00000000 --- a/.github/workflows/triage-labels.yml +++ /dev/null @@ -1,31 +0,0 @@ -# **what?** -# When the maintenance team triages, we sometimes need more information from the issue creator. In -# those cases we remove the `triage` label and add the `awaiting_response` label. Once we -# recieve a response in the form of a comment, we want the `awaiting_response` label removed -# in favor of the `triage` label so we are aware that the issue needs action. - -# **why?** -# To help with out team triage issue tracking - -# **when?** -# This will run when a comment is added to an issue and that issue has the `awaiting_response` label. - -name: Update Triage Label - -on: issue_comment - -defaults: - run: - shell: bash - -permissions: - issues: write - -jobs: - 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