From 7fca9ec2c9382aa3dc98b56fa908375ec5593d63 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Mon, 14 Mar 2022 09:18:38 -0500 Subject: [PATCH] Small changie fixes (#4857) (#4859) * fix broken links, update GHA to not repost comment * tweak GHA * convert GHA used * consolidate GHA * fix PR numbers and pull comment as var * fix name of workflow step * changie merge to fix link at top of changelog * add changelog yaml # Conflicts: # CHANGELOG.md --- .changes/header.tpl.md | 2 +- .../Under the Hood-20220311-101851.yaml | 8 +++++ .github/workflows/changelog-check.yml | 34 +++++++++++++------ CHANGELOG.md | 5 +-- 4 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 .changes/unreleased/Under the Hood-20220311-101851.yaml diff --git a/.changes/header.tpl.md b/.changes/header.tpl.md index 7baa5e9cab7..e48cb3069f6 100755 --- a/.changes/header.tpl.md +++ b/.changes/header.tpl.md @@ -3,4 +3,4 @@ - This file provides a full account of all changes to `dbt-core` and `dbt-postgres` - Changes are listed under the (pre)release in which they first appear. Subsequent releases include changes from previous releases. - "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version. -- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](CONTRIBUTING.md) +- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). 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) diff --git a/.changes/unreleased/Under the Hood-20220311-101851.yaml b/.changes/unreleased/Under the Hood-20220311-101851.yaml new file mode 100644 index 00000000000..0c03e55efcc --- /dev/null +++ b/.changes/unreleased/Under the Hood-20220311-101851.yaml @@ -0,0 +1,8 @@ +kind: Under the Hood +body: Fix broken links for changelog generation and tweak GHA to only post a comment + once when changelog entry is missing. +time: 2022-03-11T10:18:51.404524-06:00 +custom: + Author: emmyoop + Issue: "4848" + PR: "4857" diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml index 8e0a332894b..fad10a4a5ad 100644 --- a/.github/workflows/changelog-check.yml +++ b/.github/workflows/changelog-check.yml @@ -27,6 +27,9 @@ 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 @@ -48,15 +51,26 @@ jobs: filters: | changelog: - added: '.changes/unreleased/**.yaml' - - name: Check a file has been added to .changes/unreleased if required + - 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 nto exist + if: | + steps.filter.outputs.changelog == 'false' && + !contains( github.event.pull_request.labels.*.name, 'Skip Changelog') && + 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' && + !contains( github.event.pull_request.labels.*.name, 'Skip Changelog') uses: actions/github-script@v6 - if: steps.filter.outputs.changelog == 'false' && !contains( github.event.pull_request.labels.*.name, 'Skip Changelog') with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "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](CONTRIBUTING.md)." - }) - core.setFailed('Changelog entry required to merge.') + script: core.setFailed('Changelog entry required to merge.') diff --git a/CHANGELOG.md b/CHANGELOG.md index 84fc884ac02..ed0abe42b8f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,9 @@ - This file provides a full account of all changes to `dbt-core` and `dbt-postgres` - Changes are listed under the (pre)release in which they first appear. Subsequent releases include changes from previous releases. - "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version. -- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](CONTRIBUTING.md) +- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). 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) -Contributors: -* [@twilly](https://github.com/twilly) ([#4681](https://github.com/dbt-labs/dbt-core/pull/4681)) - ## dbt-core 1.0.3 (February 21, 2022) ### Fixes