-
Notifications
You must be signed in to change notification settings - Fork 660
ci: Reject PRs without CHANGELOG update #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,31 +1,22 @@ | ||
|
|
||
| <!-- | ||
| Thank you for contributing to capa! <3 | ||
|
|
||
| IMPORTANT NOTE | ||
| It's most important that you submit your improvements. So even if you don't use this complete template we look forward to collaborating! | ||
|
|
||
| Please read capa's CONTRIBUTING guide if you haven't done so already. | ||
| It contains helpful information about how to contribute to capa. Check https://github.com/fireeye/capa/blob/master/.github/CONTRIBUTING.md | ||
|
|
||
| PR template based on https://embeddedartistry.com/blog/2017/08/04/a-github-pull-request-template-for-your-projects/ | ||
| --> | ||
|
|
||
| ### Description | ||
| Please describe the changes in this pull request (PR). Include your motivation and context to help us review. | ||
|
|
||
| <!-- Please describe the changes in this PR. Include your motivation and context to help us review. --> | ||
|
|
||
| closes # (issue) | ||
|
|
||
| ### Documentation | ||
| Please mention the issue your PR addresses (if any): | ||
| closes #issue_number | ||
| --> | ||
|
|
||
| - [ ] I have updated the [CHANGELOG.md](/CHANGELOG.md), this is required for: | ||
| - Bug fixes (non-breaking change which fixes an issue) | ||
| - New features (non-breaking change which adds functionality) | ||
| - Breaking changes (fix or feature that would cause existing functionality to not work as expected) | ||
| - [ ] This change requires a documentation update | ||
| - [ ] I have made the corresponding changes to the documentation | ||
|
|
||
| ### Tests | ||
| ### Checklist | ||
|
|
||
| - [ ] I have added tests that prove my fix is effective or that my feature works | ||
| <!-- CHANGELOG.md has a `master (unreleased)` section. Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning in the release notes to this file. --> | ||
| - [ ] No CHANGELOG update needed | ||
| <!-- Tests prove that your fix/work as expected and ensure it doesn't break on the feature. --> | ||
| - [ ] No new tests needed | ||
| <!-- Please help us keeping capa documentation up-to-date --> | ||
| - [ ] No documentation update needed | ||
This file contains hidden or 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,40 @@ | ||
| name: changelog | ||
|
|
||
| on: | ||
| # We need pull_request_target instead of pull_request because a write | ||
| # repository token is needed to add a review to a PR. DO NOT BUILD | ||
| # OR RUN UNTRUSTED CODE FROM PRs IN THIS ACTION | ||
| pull_request_target: | ||
| types: [opened, edited, synchronize] | ||
|
|
||
| jobs: | ||
| check_changelog: | ||
| runs-on: ubuntu-20.04 | ||
| env: | ||
| NO_CHANGELOG: '[x] No CHANGELOG update needed' | ||
| steps: | ||
| - name: Get changed files | ||
| id: files | ||
| uses: Ana06/get-changed-files@v1.1 | ||
| - name: check changelog updated | ||
| id: changelog_updated | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
| FILES: ${{ steps.files.outputs.modified }} | ||
| run: | | ||
| echo $FILES | grep -qF 'CHANGELOG.md' || echo $PR_BODY | grep -qiF "$NO_CHANGELOG" | ||
| - name: Reject pull request if no CHANGELOG update | ||
| if: ${{ always() && steps.changelog_updated.outcome == 'failure' }} | ||
| uses: Ana06/automatic-pull-request-review@v0.1.0 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| event: REQUEST_CHANGES | ||
| body: "Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the `master (unreleased)` section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: `${{ env.NO_CHANGELOG }}`" | ||
| allow_duplicate: false | ||
| - name: Dismiss previous review if CHANGELOG update | ||
| uses: Ana06/automatic-pull-request-review@v0.1.0 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| event: DISMISS | ||
| body: "CHANGELOG updated or no update needed, thanks! :smile:" | ||
|
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more an "Unchecklist" 😉