From df90798d3195b39e04b91d4b1747738a1d7a0e44 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Mon, 17 Jun 2024 10:57:36 -0500 Subject: [PATCH 1/5] update user docs-issue workflow --- .github/workflows/docs-issue.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/docs-issue.yml diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml new file mode 100644 index 00000000..1c9fe46f --- /dev/null +++ b/.github/workflows/docs-issue.yml @@ -0,0 +1,42 @@ +# **what?** +# Open an issue in docs.getdbt.com when an issue is labeled `user docs` and closed as completed + +# **why?** +# To reduce barriers for keeping docs up to date + +# **when?** +# When an issue is labeled `user docs` and is closed as completed. Can be labeled before or after the issue is closed. + + +name: Open issues in docs.getdbt.com repo when an issue is labeled +run-name: "Open an issue in docs.getdbt.com for issue #${{ github.event.issue.number }}" + +on: + issues: + types: [labeled, closed] + +defaults: + run: + shell: bash + +permissions: + issues: write # comments on issues + +jobs: + open_issues: + # we only want to run this when the issue is closed as completed and the label `user docs` has been assigned. + # If this logic does not exist in this workflow, it runs the + # risk of duplicaton 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.state == 'closed' && + github.event.issue.state_reason == 'completed' && + contains( github.event.issue.labels.*.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 }} Issue #${{ github.event.issue.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 + \ No newline at end of file From 85f0c80ff8fc223618fb3e132b1a2eb7a853f365 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Mon, 17 Jun 2024 11:12:09 -0500 Subject: [PATCH 2/5] pre-commit fix --- .github/workflows/docs-issue.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml index 1c9fe46f..80d0e6dc 100644 --- a/.github/workflows/docs-issue.yml +++ b/.github/workflows/docs-issue.yml @@ -38,5 +38,4 @@ jobs: issue_repository: "dbt-labs/docs.getdbt.com" issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.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 - \ No newline at end of file + secrets: inherit \ No newline at end of file From 19912c5faef703f603d241f713cd9c7420aaf5a3 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Tue, 18 Jun 2024 13:34:00 -0500 Subject: [PATCH 3/5] update workflow based onf feedback --- .github/workflows/docs-issue.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml index 80d0e6dc..be1dc095 100644 --- a/.github/workflows/docs-issue.yml +++ b/.github/workflows/docs-issue.yml @@ -30,12 +30,12 @@ jobs: # 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.state == 'closed' && - github.event.issue.state_reason == 'completed' && - contains( github.event.issue.labels.*.name, 'user docs')) + (github.event.issue.state == 'closed' && github.event.issue.state_reason == 'completed') && ( + (github.event.action == 'closed' && contains(github.event.issue.labels.*.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 }} Issue #${{ github.event.issue.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 \ No newline at end of file + secrets: inherit + \ No newline at end of file From e2aaa91a59e6f3991c3804860d329501bb25b280 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Tue, 18 Jun 2024 13:38:51 -0500 Subject: [PATCH 4/5] whitespace --- .github/workflows/docs-issue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml index be1dc095..dc74b95e 100644 --- a/.github/workflows/docs-issue.yml +++ b/.github/workflows/docs-issue.yml @@ -38,4 +38,3 @@ jobs: issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.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 - \ No newline at end of file From a2ac1d8c35952b610d3b305d4b9601f435557d90 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Thu, 20 Jun 2024 10:07:43 -0500 Subject: [PATCH 5/5] update to match bigquery --- .github/workflows/docs-issue.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml index dc74b95e..f49cf517 100644 --- a/.github/workflows/docs-issue.yml +++ b/.github/workflows/docs-issue.yml @@ -31,7 +31,8 @@ jobs: # decide if it should run or not. if: | (github.event.issue.state == 'closed' && github.event.issue.state_reason == 'completed') && ( - (github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs'))) + (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"