From c61cdea65431b408fd044cd6b3197ca452e720db Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Mon, 13 Jan 2020 13:44:41 -0600 Subject: [PATCH] .github: Enable GitHub Actions pull request workflow to comment and fail 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: https://github.com/bflad/github-action-testing/pull/2 - Check not ran (which is what we want) - Adjust `CHANGELOG.md` file: https://github.com/bflad/github-action-testing/pull/4 - Check ran - Comment left in PR - Check failure displayed - Adjust `CHANGELOG.md` content then remove those changes: https://github.com/bflad/github-action-testing/pull/5 - On changes (same as before), check ran, commented, and displayed failure - On update to remove changes, check failure removed --- .github/workflows/changelog_checks.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/changelog_checks.yml diff --git a/.github/workflows/changelog_checks.yml b/.github/workflows/changelog_checks.yml new file mode 100644 index 00000000000..d8dcdac3a82 --- /dev/null +++ b/.github/workflows/changelog_checks.yml @@ -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