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

Vale GHA improvements #4304

Merged
merged 4 commits into from
May 14, 2021
Merged

Conversation

nmelehan
Copy link
Collaborator

@nmelehan nmelehan commented May 7, 2021

This PR does two things:

@nmelehan
Copy link
Collaborator Author

nmelehan commented May 7, 2021

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
Copy link
Collaborator Author

@nmelehan nmelehan May 7, 2021

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:

  1. 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 of main. I then made a pull request that targeted develop (not main) for this branch:

    • test vale stuff #4306
    • Our Vale GitHub action failed on this with the head commit error because main, which was used to start the new branch, is currently behind develop
  2. I made another new branch off of main with the proposed continue-on-error: true fix. Then I made a pull request that targeted develop (not main) for this branch:

- 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
@nmelehan
Copy link
Collaborator Author

nmelehan commented May 10, 2021

The non-squashed commit history for 569895f is located here:

#4307

That PR also adds a few test files at these locations:

./docs/guides/kubernetes/test-vale/index.md
./docs/guides/kubernetes/test-vale2/index.md
./docslist # this is just a text file

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:

Added or modified: [".github/workflows/test.yaml","docs/guides/kubernetes/test-vale/index.md","docs/guides/kubernetes/test-vale2/index.md","docslist"]

The select_docs_dir_files filtering step that was added reduces this down to:

Added or modified files located within docs/ directory:
[
  "docs/guides/kubernetes/test-vale/index.md",
  "docs/guides/kubernetes/test-vale2/index.md"
]

Note that the docslist text file is not included, because the file path filter used matches against ^docs/ and not ^docs

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
@nmelehan nmelehan changed the title Integrate workaround for "head commit not ahead of base commit" Vale GHA improvements May 10, 2021
@andystevensname andystevensname merged commit f6a3347 into linode:develop May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants