Skip to content

Commit

Permalink
Small changie fixes (#4857)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
emmyoop authored Mar 11, 2022
1 parent 1183e85 commit 0fce636
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .changes/header.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 8 additions & 0 deletions .changes/unreleased/Under the Hood-20220311-101851.yaml
Original file line number Diff line number Diff line change
@@ -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"
34 changes: 24 additions & 10 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.')
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0fce636

Please sign in to comment.