-
Notifications
You must be signed in to change notification settings - Fork 10
Validate Files In Pull Request
- Requirements
- Fork Config Repo
- Commit your changes
- Validation upon "Merge pull request" click
- Fixing errors
Requirements:
- Before you continue, make sure you have followed the instructions to setup your config repo.
- You have already Setup Config Repo Hook.
This scenario involves forking a github config repo for the creation of a Pull Request. Users usually use the fork button to create a new forked repo and start committing changes.
All commits in the forked repo are NOT validating the changes you make in the UI. For instance, consider the following commits that introduce errors to multiple files.
The validation will be executed by Github Enterprise when the commit objects are received. That will only happen you press the button Merge pull request
in the UI.
- The error about the message returned by the validator.
- The list of all files validated, including the parser's error message detailing why the file is invalid.
- Valid files are listed prefixed with
(v)
. - Invalid files are listed prefixed with
(x)
. - The name of the branch that rejected the commits to be merged in the origin.
Here's an example of such event:
At this point, the only way to push the changes to the same branch, in the forked repo, and try to merge again.
IMPORTANT
- When the validator rejects your Pull Request in the UI, the commits in the branch are still in the branch in the forked repo.
- You MUST fix the errors in the files that are in the branch in the forked repo by committing to that branch.
- Only after the fix you may try pressing the button "Merge pull request" again.
When problems are found in your commits, you have different options:
- Fix each individual file.
- Create as many new commits as desired.
- Push the changes in the forked repo.
If you prefer, you can execute the same validation script locally by downloading it.