-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create generic pull-request-bot workflow, add backporting, changelog …
…check, and bot changelog entry jobs
- Loading branch information
1 parent
8446b97
commit 7ab5c2c
Showing
1 changed file
with
67 additions
and
0 deletions.
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,67 @@ | ||
# **what?** | ||
# - verify that pull requests have a changelog entry unless otherwise specified | ||
# - create backport PRs | ||
# | ||
# **why?** | ||
# - ensure all code changes are reflected in the final CHANGELOG.md | ||
# - ensure consistent process when backporting changes | ||
# | ||
# **when?** | ||
# - when a pull request sees any change | ||
name: Pull request bot | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, labeled, unlabeled, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
backport: | ||
name: Backport | ||
runs-on: ubuntu-latest | ||
if: >- | ||
github.event.pull_request.merged && | ||
github.event.action == 'labeled' && | ||
contains(github.event.label.name, 'backport') | ||
steps: | ||
- uses: tibdex/backport@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
changelog-entry-check: | ||
name: Changelog entry 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 [dbt-postgres contributing guide](https://github.com/dbt-labs/dbt-postgres/blob/main/CONTRIBUTING.md). | ||
skip_label: Skip Changelog | ||
secrets: inherit | ||
|
||
create-bot-changelog-entry: | ||
name: Create bot changelog entry | ||
strategy: | ||
matrix: | ||
include: | ||
- label: dependencies | ||
changie_kind: Dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create and commit changelog on bot PR | ||
if: >- | ||
contains(github.event.pull_request.labels.*.name, 'dependencies') && | ||
(github.event.action == 'labeled' || github.event.action == 'opened') | ||
id: bot_changelog | ||
uses: emmyoop/changie_bot@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }} | ||
commit_author_name: Github Build Bot | ||
commit_author_email: <[email protected]> | ||
commit_message: '[automated] add changelog entry for dependabot PR' | ||
changie_kind: Dependencies | ||
label: dependencies | ||
custom_changelog_string: 'custom:\n Author: ${{ github.event.pull_request.user.login }}\n PR: ${{ github.event.pull_request.number }}' |