-
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
Vale GHA improvements #4304
Conversation
Workaround proposed here: jitterbit/get-changed-files#11 (comment)
Deploy preview for nostalgic-ptolemy-b01ab8 ready! Built with commit c5155f1 https://deploy-preview-4304--nostalgic-ptolemy-b01ab8.netlify.app |
@@ -39,6 +39,7 @@ jobs: | |||
- name: Get Changed Files | |||
id: get_changed_files | |||
uses: jitterbit/get-changed-files@v1 | |||
continue-on-error: true |
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:- test vale stuff #4306
- Our Vale GitHub action failed on this with the
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:- Testing out: Integrate workaround for "head commit not ahead of base commit" #4305
- Our Vale GitHub action passes on this PR, even though
main
, which was used to start the new branch, is currently behinddevelop
.
- This helps avoid Vale running on non-content markdown files, like our typography test page. - A new select_docs_dir_files step is added. This step parses and filters the JSON added_modified output from the get_changed_files step. It then sets a new output for this filtered file list that the Vale step later reads from. - The jq command is used to filter the JSON list of files: https://stedolan.github.io/jq/ - This Stack Overflow served as inspiration: https://stackoverflow.com/questions/64482190/edit-the-value-inside-the-json-array-with-github-actions
The non-squashed commit history for 569895f is located here: That PR also adds a few test files at these locations:
You can see test output for the updated Vale GHA in that other PR here: https://github.com/linode/docs/pull/4307/checks?check_run_id=2546663556 Specifically, the get_changed_files step lists these added/modified files:
The select_docs_dir_files filtering step that was added reduces this down to:
Note that the |
When the list of files was empty after the select_docs_dir_files step ran, the action would hang at the Vale step: https://github.com/linode/docs/pull/4304/checks?check_run_id=2546802169
This PR does two things:
Integrate a workaround for the "head commit not ahead of base commit" error. Workaround proposed here:
The head commit for this pull_request event is not ahead of the base commit jitterbit/get-changed-files#11 (comment)
Filter out files that are not in the docs/ directory
This helps us avoid running Vale on non-content files, like our typography test page at _vendor/github.com/linode/linode-docs-theme/content/typografy-test.md