-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Vale GHA improvements #4304
Merged
andystevensname
merged 4 commits into
linode:develop
from
nmelehan:vale-gha-improvements
May 14, 2021
Merged
Vale GHA improvements #4304
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c551efc
Integrate workaround for "head commit not ahead of base commit"
nmelehan 569895f
Vale GHA: filter out files that aren't inside docs/ directory
nmelehan a1b3bf4
Only run the Vale step if list of files in docs/ is not empty
nmelehan c5155f1
Vale GHA: add comments
nmelehan 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 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 |
---|---|---|
|
@@ -39,12 +39,35 @@ jobs: | |
- name: Get Changed Files | ||
id: get_changed_files | ||
uses: jitterbit/get-changed-files@v1 | ||
# The continue-on-error parameter is set to true as a | ||
# workaround for the `head commit is not ahead of base | ||
# commit` error that can appear when the PR branch is | ||
# out of date. | ||
continue-on-error: true | ||
with: | ||
format: 'json' | ||
- name: Install more-utils | ||
run: sudo apt-get install moreutils | ||
- name: Select Files in Docs Dir | ||
# This action filters the list of added and modified | ||
# files to only the files that are in the docs/ directory | ||
id: select_docs_dir_files | ||
run: | | ||
docs_dir_files=$(echo $added_modified | jq -c '[.[] | select(.|test("^docs/"))]') | ||
echo "::set-output name=added_modified::$docs_dir_files" | ||
echo "Added or modified files located within docs/ directory:" | ||
echo $docs_dir_files | jq '.' | ||
env: | ||
added_modified: ${{ steps.get_changed_files.outputs.added_modified }} | ||
- name: Vale | ||
uses: errata-ai/[email protected] | ||
# Only run the Vale step if the list of added and modified | ||
# files inside the docs directory is not empty. If we don't | ||
# add this conditional, the Vale step hangs and never | ||
# completes when it is passed the empty array. | ||
if: ${{ '[]' != steps.select_docs_dir_files.outputs.added_modified }} | ||
with: | ||
files: '${{ steps.get_changed_files.outputs.added_modified }}' | ||
files: '${{ steps.select_docs_dir_files.outputs.added_modified }}' | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
|
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.
This is how c551efc was tested out:
I made a new branch off of
main
with a new test markdown file. The file doesn't matter; what matters is that the branch was made off ofmain
. I then made a pull request that targeteddevelop
(notmain
) for this branch:head commit
error becausemain
, which was used to start the new branch, is currently behinddevelop
I made another new branch off of
main
with the proposedcontinue-on-error: true
fix. Then I made a pull request that targeteddevelop
(notmain
) for this branch:main
, which was used to start the new branch, is currently behinddevelop
.