From dad919041a4262fae23efd8faf1b58148f601765 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 13:51:03 -0500 Subject: [PATCH 01/16] convert to reusable action --- .github/workflows/changelog-check.yml | 44 ++------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index cb955bc8d38..e20c52ea140 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -31,48 +31,10 @@ permissions: contents: read pull-requests: write -env: - changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' - jobs: changelog: - name: changelog - if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')" - runs-on: ubuntu-latest - steps: - - name: Check if changelog file was added - # https://github.com/marketplace/actions/paths-changes-filter - # For each filter, it sets output variable named by the filter to the text: - # 'true' - if any of changed files matches any of filter rules - # 'false' - if none of changed files matches any of filter rules - # also, returns: - # `changes` - JSON array with names of all filters matching any of the changed files - uses: dorny/paths-filter@v2 - id: filter - with: - token: ${{ secrets.GITHUB_TOKEN }} - filters: | - changelog: - - added: '.changes/unreleased/**.yaml' - - name: Check if comment already exists - uses: peter-evans/find-comment@v1 - id: changelog_comment - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: ${{ env.changelog_comment }} - - name: Create PR comment if changelog entry is missing, required, and does not exist - if: | - steps.filter.outputs.changelog == 'false' && - steps.changelog_comment.outputs.comment-body == '' - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - body: ${{ env.changelog_comment }} - - name: Fail job if changelog entry is missing and required - if: steps.filter.outputs.changelog == 'false' - uses: actions/github-script@v6 - with: - script: core.setFailed('Changelog entry required to merge.') + - name: Check Changelog Exists + id: check-changelog + uses: dbt-labs/actions/check-changelog@changelog-check From 3fa193d83b550d820b1844c504a06c06332b8d09 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 13:55:46 -0500 Subject: [PATCH 02/16] fix branch name --- .github/workflows/changelog-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index e20c52ea140..0462a2074e5 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -37,4 +37,4 @@ jobs: steps: - name: Check Changelog Exists id: check-changelog - uses: dbt-labs/actions/check-changelog@changelog-check + uses: dbt-labs/actions/check-changelog@er/changelog-check From 51bccde0ab9f57384d90dd5dc3a54c2fca113e1d Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 14:06:47 -0500 Subject: [PATCH 03/16] reimplemented changelog --- .github/README.md | 4 ++-- .github/workflows/changelog-check.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index 6251257ecd5..928c3b36c6f 100644 --- a/.github/README.md +++ b/.github/README.md @@ -112,7 +112,7 @@ Some triggers of note that we use: ```yaml job1: - - name: [DEBUG] Print Variables + - name: "[DEBUG] Print Variables" run: | echo "all variables defined as inputs" echo The last commit sha in the release: ${{ inputs.sha }} @@ -132,7 +132,7 @@ Some triggers of note that we use: job2: needs: [job1] - - name: '[DEBUG] Print Variables' + - name: "[DEBUG] Print Variables" run: | echo "all variables defined in job1 > Set Variables > outputs" echo "important_path: ${{ needs.job1.outputs.important_path }}" diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index 0462a2074e5..9dca1fc7506 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -33,7 +33,9 @@ permissions: jobs: changelog: + if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')" runs-on: ubuntu-latest + steps: - name: Check Changelog Exists id: check-changelog From d803b29a76478697a7555128853f30c2977e9d08 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 14:29:34 -0500 Subject: [PATCH 04/16] update to use workflow --- .github/README.md | 16 +++++++++------- .github/workflows/changelog-check.yml | 3 +-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/README.md b/.github/README.md index 928c3b36c6f..2637af24e13 100644 --- a/.github/README.md +++ b/.github/README.md @@ -108,19 +108,21 @@ Some triggers of note that we use: - Print out all variables you will reference as the first step of a job. This allows for easier debugging. The first job should log all inputs. Subsequent jobs should reference outputs of other jobs, if present. - When possible, generate variables at the top of your workflow in a single place to reference later. This is not always strictly possible since you may generate a value to be used lated mid-workflow. + When possible, generate variables at the top of your workflow in a single place to reference later. This is not always strictly possible since you may generate a value to be used later mid-workflow. + + Be sure to use quotes around these logs so special characters are not interpreted. ```yaml job1: - name: "[DEBUG] Print Variables" run: | echo "all variables defined as inputs" - echo The last commit sha in the release: ${{ inputs.sha }} - echo The release version number: ${{ inputs.version_number }} - echo The changelog_path: ${{ inputs.changelog_path }} - echo The build_script_path: ${{ inputs.build_script_path }} - echo The s3_bucket_name: ${{ inputs.s3_bucket_name }} - echo The package_test_command: ${{ inputs.package_test_command }} + echo "The last commit sha in the release: ${{ inputs.sha }}" + echo "The release version number: ${{ inputs.version_number }}" + echo "The changelog_path: ${{ inputs.changelog_path }}" + echo "The build_script_path: ${{ inputs.build_script_path }}" + echo "The s3_bucket_name: ${{ inputs.s3_bucket_name }}" + echo "The package_test_command: ${{ inputs.package_test_command }}" # collect all the variables that need to be used in subsequent jobs - name: Set Variables diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index 9dca1fc7506..ae35b724ca9 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -33,10 +33,9 @@ permissions: jobs: changelog: - if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')" runs-on: ubuntu-latest steps: - name: Check Changelog Exists id: check-changelog - uses: dbt-labs/actions/check-changelog@er/changelog-check + uses: dbt-labs/actions/.gtihub/workflows/changelog-check.yml@er/changelog-check From 3f518dc5aa0e314c52835314b5a98063b74365e4 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 14:32:09 -0500 Subject: [PATCH 05/16] fix typo --- .github/workflows/changelog-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index ae35b724ca9..b3cf22d3d5c 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -38,4 +38,4 @@ jobs: steps: - name: Check Changelog Exists id: check-changelog - uses: dbt-labs/actions/.gtihub/workflows/changelog-check.yml@er/changelog-check + uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check From 95642a13e171df04d27ff91c65894ac58fc531c8 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 14:35:25 -0500 Subject: [PATCH 06/16] move def --- .github/workflows/changelog-check.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index b3cf22d3d5c..a61bf8f6049 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -33,9 +33,4 @@ permissions: jobs: changelog: - runs-on: ubuntu-latest - - steps: - - name: Check Changelog Exists - id: check-changelog - uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check + uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check From 3bf9b99f92b3809d9ec62567edd332707cd6074d Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 14:38:41 -0500 Subject: [PATCH 07/16] inherit secrets --- .github/workflows/changelog-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index a61bf8f6049..f8dc408b024 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -34,3 +34,4 @@ permissions: jobs: changelog: uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check + secrets: inherit # this is only acceptable because we own the action we're calling From c23482a2dea276a35f869e2804e71090c3c57381 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 27 Jul 2022 15:22:19 -0500 Subject: [PATCH 08/16] send in comment/label --- .github/workflows/changelog-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index f8dc408b024..5f915bf956a 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -34,4 +34,7 @@ permissions: jobs: changelog: uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check + with: + changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' + skip_label: 'Skip Changelog' secrets: inherit # this is only acceptable because we own the action we're calling From b25a55c4df6676c9fcdbfc7eec1e688125ec1a80 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Mon, 1 Aug 2022 14:25:23 -0500 Subject: [PATCH 09/16] specify GITHUB_TOKEN --- .github/workflows/changelog-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index 5f915bf956a..d1921c40973 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -37,4 +37,5 @@ jobs: with: changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' skip_label: 'Skip Changelog' - secrets: inherit # this is only acceptable because we own the action we're calling + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 17e27de3130af5607c81062db044803e619b85ba Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Mon, 1 Aug 2022 19:38:16 +0000 Subject: [PATCH 10/16] Add automated changelog yaml from template for bot PR --- .changes/unreleased/Dependency-20220801-193810.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changes/unreleased/Dependency-20220801-193810.yaml diff --git a/.changes/unreleased/Dependency-20220801-193810.yaml b/.changes/unreleased/Dependency-20220801-193810.yaml new file mode 100644 index 00000000000..dea1301d379 --- /dev/null +++ b/.changes/unreleased/Dependency-20220801-193810.yaml @@ -0,0 +1,8 @@ +kind: Dependency +body: "convert to reusable action" +time: 2022-08-01T19:38:10.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 5565 + From a56cbe6e5ca47d427aca8ffa2cb378e6c48487d9 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Mon, 1 Aug 2022 14:38:35 -0500 Subject: [PATCH 11/16] Delete Dependency-20220801-193810.yaml --- .changes/unreleased/Dependency-20220801-193810.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .changes/unreleased/Dependency-20220801-193810.yaml diff --git a/.changes/unreleased/Dependency-20220801-193810.yaml b/.changes/unreleased/Dependency-20220801-193810.yaml deleted file mode 100644 index dea1301d379..00000000000 --- a/.changes/unreleased/Dependency-20220801-193810.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Dependency -body: "convert to reusable action" -time: 2022-08-01T19:38:10.00000Z -custom: - Author: emmyoop - Issue: 4904 - PR: 5565 - From e58de6fa758e0fc9356f3208fc3563f5cdcc8896 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Mon, 1 Aug 2022 19:39:21 +0000 Subject: [PATCH 12/16] Add automated changelog yaml from template for bot PR --- .changes/unreleased/Dependency-20220801-193916.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changes/unreleased/Dependency-20220801-193916.yaml diff --git a/.changes/unreleased/Dependency-20220801-193916.yaml b/.changes/unreleased/Dependency-20220801-193916.yaml new file mode 100644 index 00000000000..8b3f6b80c08 --- /dev/null +++ b/.changes/unreleased/Dependency-20220801-193916.yaml @@ -0,0 +1,8 @@ +kind: Dependency +body: "convert to reusable action" +time: 2022-08-01T19:39:16.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 5565 + From 81122e22fe0965ca5ad425b525791f29d20b4425 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 2 Aug 2022 09:07:52 -0500 Subject: [PATCH 13/16] remove dummy changelog --- .changes/unreleased/Dependency-20220801-193916.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .changes/unreleased/Dependency-20220801-193916.yaml diff --git a/.changes/unreleased/Dependency-20220801-193916.yaml b/.changes/unreleased/Dependency-20220801-193916.yaml deleted file mode 100644 index 8b3f6b80c08..00000000000 --- a/.changes/unreleased/Dependency-20220801-193916.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Dependency -body: "convert to reusable action" -time: 2022-08-01T19:39:16.00000Z -custom: - Author: emmyoop - Issue: 4904 - PR: 5565 - From 5b97ca7699cf9651929fe61ca783067019d6b961 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 2 Aug 2022 09:09:36 -0500 Subject: [PATCH 14/16] remove token --- .github/workflows/changelog-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index d1921c40973..dfa5d830639 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -37,5 +37,4 @@ jobs: with: changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' skip_label: 'Skip Changelog' - secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + secrets: inherit From b6534926c0e3945c53f51a812d4a4d3b28d7ea66 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 2 Aug 2022 09:48:32 -0500 Subject: [PATCH 15/16] rename file --- .../workflows/{changelog-check.yml => changelog-existence.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{changelog-check.yml => changelog-existence.yml} (93%) diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-existence.yml similarity index 93% rename from .github/workflows/changelog-check.yml rename to .github/workflows/changelog-existence.yml index dfa5d830639..8950b832f41 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-existence.yml @@ -33,7 +33,7 @@ permissions: jobs: changelog: - uses: dbt-labs/actions/.github/workflows/changelog-check.yml@er/changelog-check + uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@er/changelog-check with: changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' skip_label: 'Skip Changelog' From e8f3b08bd7f8c1d8b0586c00de9038db62b828d0 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 2 Aug 2022 20:28:10 -0500 Subject: [PATCH 16/16] point to main --- .github/workflows/changelog-existence.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-existence.yml b/.github/workflows/changelog-existence.yml index 8950b832f41..7be8c1accb5 100644 --- a/.github/workflows/changelog-existence.yml +++ b/.github/workflows/changelog-existence.yml @@ -33,7 +33,7 @@ permissions: jobs: changelog: - uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@er/changelog-check + uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main with: changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).' skip_label: 'Skip Changelog'