Skip to content

Config Mod Updates

Config Mod Updates #3

Workflow file for this run

name: README-Lint
on:
pull_request:
branches:
- main
jobs:
lint-README:
name: Lint README file
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Lint README file
uses: docker://avtodev/markdown-lint:v1 # fastest way
id: lintFile
with:
rules: './.github/workflows/customrules.js'
config: '/lint/config/changelog.yml'
output: './.github/md_lint_output.txt'
args: './README.md'
- name: Output file contents
id: outputCont
if: ${{ failure() }}
run: |
OUTPUT_STRING=$(cat $(pwd)/.github/md_lint_output.txt)
OUTPUT_STRING="${OUTPUT_STRING//'%'/'%25'}"
OUTPUT_STRING="${OUTPUT_STRING//$'\n'/'%0A'}"
OUTPUT_STRING="${OUTPUT_STRING//$'\r'/'%0D'}"
echo "::set-output name=outFile::$OUTPUT_STRING"
- name: Create Fail Comment
uses: actions/github-script@v5
if: ${{ failure() }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{steps.outputCont.outputs.outFile}}`
})
- name: Create Success Comment
uses: actions/github-script@v5
if: ${{ success() }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Markdown Valid'
})