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 5974fc1e155..b4a4ece6194 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ - 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) -*** below changes will need to be manually merged with the changes generated by `changie batch` for 1.1.0. This is a one time manual step caused by changie being introduced mid-development. *** +*** below changes will need to be manually merged with the changes generated by `changie batch` for 1.1.0. Once the two are merged, this file should be deleted. This is a one time thing because changie was introduced mid-development. *** ## dbt-core 1.1.0 (TBD)