Skip to content

Commit

Permalink
.github: Enable GitHub Actions pull request workflow to comment and f…
Browse files Browse the repository at this point in the history
…ail on CHANGELOG.md changes (#11571)

Reference: https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md#pull-requests

This was verified in a separate testing repository:

- Adjust non-`CHANGELOG.md` file: bflad/github-action-testing#2
  - Check not ran (which is what we want)
- Adjust `CHANGELOG.md` file: bflad/github-action-testing#4
  - Check ran
  - Comment left in PR
  - Check failure displayed
- Adjust `CHANGELOG.md` content then remove those changes: bflad/github-action-testing#5
  - On changes (same as before), check ran, commented, and displayed failure
  - On update to remove changes, check failure removed
  • Loading branch information
bflad authored Jan 13, 2020
1 parent 6afebbc commit c61cdea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/changelog_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CHANGELOG Checks
on:
pull_request:
paths:
- CHANGELOG.md

jobs:
PRCheck:
name: PR Check
runs-on: ubuntu-latest
steps:
- name: PR Comment
uses: unsplash/comment-on-pr@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |-
Thank you for your contribution! :rocket:
Please note that the `CHANGELOG.md` file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the [Contributing Guide](https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md) for additional pull request review items.
Remove any changes to the `CHANGELOG.md` file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request.
- name: Fail the check
run: exit 1

0 comments on commit c61cdea

Please sign in to comment.