-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7080796
commit 87f439a
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: "Changelog entry check" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package: | ||
description: "Choose the package to test" | ||
type: string | ||
default: "dbt-adapters" | ||
issue: | ||
description: "The issue/PR number" | ||
type: string | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
changelog-check: | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') }} | ||
outputs: | ||
exists: ${{ steps.changelog.outputs.exists }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: changelog | ||
uses: dorny/paths-filter@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
filters: | | ||
exists: | ||
- added|modified: '${{ inputs.package }}/.changes/unreleased/**.yaml' | ||
comment: | ||
needs: changelog-check | ||
if: needs.changelog-check.outputs.exists == false | ||
runs-on: ubuntu-latest | ||
env: | ||
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-adapters/blob/main/CONTRIBUTING.md). | ||
steps: | ||
- id: comment | ||
uses: peter-evans/find-comment@v3 | ||
with: | ||
issue-number: ${{ inputs.issue }} | ||
comment-author: "github-actions[bot]" | ||
body-includes: ${{ env.COMMENT }} | ||
- if: steps.comment.outputs.comment-body == '' | ||
run: gh issue comment ${{ inputs.issue }} --repo ${{ github.repository }} --body "${{ env.COMMENT }}" | ||
shell: bash | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: core.setFailed('Changelog entry required to merge.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters