diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index c889794d..9d0e7ddc 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -17,9 +17,9 @@ on: - main workflow_call: inputs: - enable-spell-check: + skip-spell-check: required: false - default: false + default: true type: boolean config-links-path: required: false @@ -77,7 +77,7 @@ jobs: uses: DavidAnson/markdownlint-cli2-action@v11 with: fix: true - config: ${{ github.event_name == 'workflow_call' && inputs.config-lint-path || '.github/config/.markdownlint.json' }} + config: ${{ inputs.config-lint-path || '.github/config/.markdownlint.json' }} globs: ${{ inputs.md-lint-globs || '**/*.{md,MD}' }} - name: Commit markdown-lint changes run: | @@ -90,17 +90,18 @@ jobs: - name: Check links (.md) uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - config-file: ${{ github.event_name == 'workflow_call' && inputs.config-link-path || '.github/config/md-link-config.json' }} + config-file: ${{ inputs.config-link-path || '.github/config/md-link-config.json' }} use-verbose-mode: 'yes' - name: Check links (.MD) uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - config-file: ${{ github.event_name == 'workflow_call' && inputs.config-link-path || '.github/config/md-link-config.json' }} + config-file: ${{ inputs.config-link-path || '.github/config/md-link-config.json' }} use-verbose-mode: 'yes' file-extension: '.MD' markdown-spellchecker: - if: ${{ (github.event_name == 'workflow_call' && inputs.enable-spell-check) || github.event_name != 'workflow_call' }} runs-on: ubuntu-latest + needs: changes + if: ${{ needs.changes.outputs.files-changed == 'true' && (!inputs.skip-spell-check || inputs.skip-spell-check == '') }} steps: - uses: actions/checkout@v3 with: diff --git a/README.MD b/README.MD index 1b97c4c8..22b321f8 100644 --- a/README.MD +++ b/README.MD @@ -17,7 +17,8 @@ The repository includes: - [clean-up-storage](.github/workflows/clean-up-storage.yaml) workflow: when a new PR is closed, related cache and artefact are deleted. - [markdown](.github/workflows/markdown.yaml) workflow: lint all markdown - documents and checks that links referenced in the documents are valid. + documents and checks that links referenced in the documents are valid. If + `skip-spell-check: false`, also a spell checker is executed. - [release-notes](.github/workflows/release-notes.yaml) workflow: automatically updates release notes using PR titles and labels. - [golang](.github/workflows/golang.yaml) workflow: lint, test and benchmark Go diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 31af3802..002175d5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,6 +29,8 @@ - golang workflow: add shell configuration to enable `pipefail` for benchmark job (PR #56 by @cosimomeli) +- markdown workflow: fix check to enable/disable spellchecker (PR #55 by + @chicco785) - add-to-project workflow: Fix assignment of reviewers also when PR is still in draft mode (PR #40 by @chicco785) - Release-notes workflow: fix default configuration to include only current PR