GitHub Action linting markdown & its frontmatter content.
This repo has been created with yarn
.
To be able to test the action also install act
.
Further, to publish the action without node_modules
coming in the way,
install ncc.
To ease formatting, prettier
is installed and may be called for testing with:
yarn format
and with
yarn format:fix
to automatically fix formatting.
More info on creating JavaScript GitHub actions may be found on GitHub.
This action checks all added files of a push / PR to the solana-labs/ecosystem repo.
Input Name | Required | Default | Description |
---|---|---|---|
repoToken | true | - | The GITHUB_TOKEN to be bale to post comments on the PR. |
debug | false | false | Show additional info. |
changed-files | true | - | Which files to lint, get from tj-actions/changed-files |
directories | false | "projects", "img" | Multiple directories to search in. |
markdown-extensions | true | ".md", ".mdx" | Multiple extensions of Markdown files to check for. |
image-extensions | false | ".svg", ".png", ".jpg", ".jpeg" | Multiple extensions of image files to check for. |
fuzzy-search | false | true | Should the existing projects be checked for duplicates with nearest neighbor (fuzzy) search. |
force-check | false | false | Check all files instead of only added ones. |
Which files where changed.
- name: Lint Current PR
id: lint
uses: timhagn/lint-md-fm@v1.0.12
with:
changed-files: ${{ steps.changed_files.outputs.all_modified_files }}
directories: |
projects
img
markdown-extensions: |
md
mdx
image-extensions: |
png
svg
jpg
jpeg
fuzzy-search: true
Adapt this action to one we can use to check the ecosystem projects for:
- project files in a PR not correctly named
{project-name}.md
with.md
ext - missing or misnamed logo files
- logo files in the wrong format (not SVG / PNG / JPG)
- (only for bonus-points: image sizes)
- categories not in the
CATEGORY_MAPPING
- add strict / fuzzy matching for
slug
&title
duplicate checking - cleaned up reporting / logging
- adapt this README file to the functionality of the final action
Possible additions:
- add
force-check
option to check all files - get
CATEGORY_MAPPING
from solana-com (API call)
Find gray-matter
already
installed to work with Markdown & Frontmatter.