Skip to content
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

Add GitHub action to auto-approve docs PRs #3006

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Nov 9, 2021

Adds a CI step which looks at what changed in a PR. If it's "only" docs which changed, then the PR gets an automatic review approval.

Comments

Reviews aren't automatically dismissed if non-docs changes are added to the PR. That would require some modifications to the https://github.com/hmarr/auto-approve-action code.

Issue Number

ADP-1254

@rvl rvl self-assigned this Nov 9, 2021
@rvl rvl force-pushed the rvl/adp-1254/auto-approve-docs branch 7 times, most recently from 669ed9b to 9a8f09b Compare November 9, 2021 04:40
Copy link
Contributor

@sevanspowell sevanspowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Checked the check-scope.sh script locally and it seems to work.

# Note that GitHub actions do not run from forked repos, so this
# will only approve PRs from branches in the main repo.
- name: 'Approve Docs'
if: "${{ steps.check.outputs.scope == 'docs' }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output of check-scope.sh is an array, which is then assigned to steps.check.outputs.scope. So you're checking that an array is equal to a single element? What happens in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not an array, just a normal string.
So I want to check that there was exactly one top-level directory changed, and it was docs. This can be done with string comparison.

Your point stands, however. I realise that I was not handling multi-line strings properly when setting the output variable. I just pushed an amended commit which reworks newline handling.

@rvl rvl force-pushed the rvl/adp-1254/auto-approve-docs branch from 9a8f09b to 6240d50 Compare November 9, 2021 06:26
@rvl rvl force-pushed the rvl/adp-1254/auto-approve-docs branch from 6240d50 to 768369c Compare November 9, 2021 06:44
@rvl rvl merged commit b0f8d7a into master Nov 9, 2021
@rvl rvl deleted the rvl/adp-1254/auto-approve-docs branch November 9, 2021 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants