From 79e77b8490e8140e0f9f1754abd2d3be63e6e675 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 19:57:55 +0200 Subject: [PATCH 01/39] Adding markdown-lint action and workflow --- .github/actions/markdown-lint/action.yml | 34 +++++++ .../markdown-lint/lombiq.markdownlint.json | 18 ++++ .github/actions/yaml-lint/action.yml | 3 +- .github/workflows/markdown-lint-this-repo.yml | 13 +++ .github/workflows/markdown-lint.yml | 94 +++++++++++++++++++ Docs/Actions.md | 2 + Docs/Workflows.md | 3 +- .../Workflows/Productivity/MarkdownLinting.md | 16 ++++ Docs/Workflows/Productivity/YamlLinting.md | 2 +- 9 files changed, 181 insertions(+), 4 deletions(-) create mode 100644 .github/actions/markdown-lint/action.yml create mode 100644 .github/actions/markdown-lint/lombiq.markdownlint.json create mode 100644 .github/workflows/markdown-lint-this-repo.yml create mode 100644 .github/workflows/markdown-lint.yml create mode 100644 Docs/Workflows/Productivity/MarkdownLinting.md diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml new file mode 100644 index 000000000..d712d3f23 --- /dev/null +++ b/.github/actions/markdown-lint/action.yml @@ -0,0 +1,34 @@ +name: Markdown Linting +description: > + Lints markdown files by wrapping the markdownlint-cli2 action + (https://github.com/DavidAnson/markdownlint-cli2-action). + +# When updating defaults here also update them in the `markdown-lint` workflow. +inputs: + config: + description: Path to a file to use for the base configuration object (defaults to "lombiq.markdownlint.json"). + default: 'lombiq.markdownlint.json' + required: false + fix: + description: Whether to fix issues automatically for the rules that support it (any truthy value enables). + default: '' + required: false + globs: + description: Glob expression(s) of files to lint (newline-delimited). + default: '*.{md,markdown}' + required: false + separator: + description: String to use as a separator for the "globs" input (defaults to newline). + default: "\n" + required: false + +runs: + using: 'composite' + steps: + - name: Markdown Linting + uses: DavidAnson/markdownlint-cli2-action@3aaa38e446fbd2c288af4291aa0f55d64651050f # v12.0.0 + with: + config: ${{ inputs.config }} + fix: ${{ inputs.fix }} + globs: ${{ inputs.globs }} + separator: ${{ inputs.separator }} diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json new file mode 100644 index 000000000..7970d5e73 --- /dev/null +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -0,0 +1,18 @@ +{ + "default": true, + "MD004": { + "style": "dash" + }, + "MD013": false, + "MD033": { + "allowed_elements": [ + "kbd" + ] + }, + "MD049": { + "style": "underscore" + }, + "MD050": { + "style": "asterisk" + } +} diff --git a/.github/actions/yaml-lint/action.yml b/.github/actions/yaml-lint/action.yml index 3fbf5d0e1..b2a9bef23 100644 --- a/.github/actions/yaml-lint/action.yml +++ b/.github/actions/yaml-lint/action.yml @@ -1,7 +1,6 @@ name: YAML Linting description: Runs a linter on YAML files. - inputs: config-file-path: description: 'Path to the yamllint configuration file' @@ -14,7 +13,7 @@ inputs: default: '.' runs: - using: "composite" + using: 'composite' steps: - name: Run yamllint run: yamllint -c "${{ inputs.config-file-path }}" "${{ inputs.search-path }}" diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml new file mode 100644 index 000000000..bb1690d8c --- /dev/null +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -0,0 +1,13 @@ +name: Markdown Linting + +# Runs for PRs opened for any branch, and pushes to the dev branch. +on: + pull_request: + push: + branches: + - dev + +jobs: + markdown-linting: + name: Markdown Linting + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml new file mode 100644 index 000000000..9693a14a0 --- /dev/null +++ b/.github/workflows/markdown-lint.yml @@ -0,0 +1,94 @@ +name: Markdown Linting + +concurrency: + # If "cancel-in-progress-for-this-pr" is set to "true" and this is running for a pull request, then the concurrency + # key will be constructed from the name of the workflow and the branch name, causing the already running job in this + # workflow for this pull request to be cancelled. Otherwise it will be the ID of the workflow run, making it globally + # unique and not cancel anything. Concurrency is defined for the whole workflow, because it has only one job. A + # technical name for this workflow is also included in both cases, so that it doesn't come into conflict with other + # jobs calling a different workflow that are started by the same caller workflow. + group: | + ${{ + inputs.cancel-in-progress-for-this-pr == 'true' && github.event_name == 'pull_request' + && format('{0}_markdown-lint_{1}', github.workflow, github.ref) + || format('{0}_markdown-lint', github.run_id) + }} + cancel-in-progress: ${{ inputs.cancel-in-progress-for-this-pr == 'true' }} + +on: + workflow_call: + secrets: + CHECKOUT_TOKEN: + required: false + description: > + The GitHub token to authenticate checkout. Pass in a GitHub personal access token if authenticated submodules + are used. + + # When updating defaults here also update them in the `markdown-lint` action. + inputs: + cancel-in-progress-for-this-pr: + description: > + When set to "true", it will cancel the already running workflow for this pull request. See the concurrency + settings of the workflow above for more details. + type: string + default: 'true' + cancel-workflow-on-failure: + description: When set to "true", it will cancel the current workflow run with all jobs if this workflow fails. + type: string + default: 'true' + config: + description: Path to a file to use for the base configuration object (defaults to "lombiq.markdownlint.json"). + type: string + default: '../actions/markdown-lint/lombiq.markdownlint.json' + fix: + description: Whether to fix issues automatically for the rules that support it (any truthy value enables). + type: string + default: '' + globs: + description: Glob expression(s) of files to lint (newline-delimited). + type: string + default: '*.{md,markdown}' + separator: + description: String to use as a separator for the "globs" input (defaults to newline). + type: string + default: "\n" + timeout-minutes: + type: number + default: 3 + description: Configuration for the timeout-minutes parameter of the workflow. + +jobs: + markdown-linting: + name: Markdown Linting + runs-on: ubuntu-22.04 + timeout-minutes: ${{ inputs.timeout-minutes }} + steps: + - name: Checkout + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + with: + token: ${{ secrets.CHECKOUT_TOKEN }} + + # This is a workaround to be able to check submodules too in the repository. + - name: Stub repo layout + shell: pwsh + run: | + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + Remove-Item .\.git\ -recurse -force + git init . + git add . + git commit -m 'stub commit -- includes submodules' + + - name: Markdown Linting + uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@dev + with: + config: ${{ inputs.config }} + fix: ${{ inputs.fix }} + globs: ${{ inputs.globs }} + separator: ${{ inputs.separator }} + + - name: Cancel Workflow on Failure + if: failure() && inputs.cancel-workflow-on-failure == 'true' + uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Docs/Actions.md b/Docs/Actions.md index f6d487396..f90ee050a 100644 --- a/Docs/Actions.md +++ b/Docs/Actions.md @@ -29,10 +29,12 @@ In addition to the below short explanations, check out the inline documentation - `cancel-workflow`: Cancels the current workflow run, i.e. all jobs. Useful if you want to cancel the rest of the workflow when one job fails. Suitable workflows in this project expose this functionality via the `cancel-workflow-on-failure` parameter. - `check-merge-conflict`: Labels and comments on pull requests with merge conflicts. - `create-jira-issues-for-community-activities`: Creates Jira issues for community activities happening on GitHub, like issues, discussions, and pull requests being opened. Pull requests are only taken into account if they're not already related to a Jira issue (by starting their title with a Jira issue key). +- `markdown-lint`: Checks for linting errors in markdown files, allowing for an optional configuration file to be used. Based on the [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2-action) action. - `publish-nuget`: Publishes the content of the current directory as a NuGet package. - `update-github-issue-and-pull-request`: Adds the Jira issue key prefix and link to pull requests as well as a Fixes reference to a GitHub issue, if a suitable one is found. - `verify-submodule-pull-request`: Assuming that the current repository is a submodule in another repository, this action verifies that a pull request with a matching issue code has been opened there as well. - `spelling`: Checks for spelling mistakes in a repository. Check out [this action's own documentation](SpellCheckingConfiguration.md) on how to use it and contribute to the configuration and dictionaries. +- `yaml-lint`: Checks for linting errors in YAML-files, allowing for an optional configuration file to be used. ## Azure hosting diff --git a/Docs/Workflows.md b/Docs/Workflows.md index 38dd02d45..ee1f7ea8d 100644 --- a/Docs/Workflows.md +++ b/Docs/Workflows.md @@ -25,12 +25,13 @@ These features are designed to reduce resource usage (like paid GitHub Actions m ## Productivity - [Create Jira issues for community activities](Workflows/Productivity/CreateJiraIssuesForCommunityActivities.md) +- [Markdown linting](Workflows/Productivity/MarkdownLinting.md) - [Post-pull request checks automation](Workflows/Productivity/PostPullRequestChecksAutomation.md) - [Publish NuGet package](Workflows/Productivity/PublishNuGetPackage.md) - [Spell-checking](Workflows/Productivity/SpellChecking.md) - [Validate pull request](Workflows/Productivity/ValidatePullRequest.md) - [Validate submodule](Workflows/Productivity/ValidateSubmodule.md) -- [Lint YAML files](Workflows/Productivity/YamlLinting.md) +- [YAML linting](Workflows/Productivity/YamlLinting.md) ## Azure hosting diff --git a/Docs/Workflows/Productivity/MarkdownLinting.md b/Docs/Workflows/Productivity/MarkdownLinting.md new file mode 100644 index 000000000..da32ab956 --- /dev/null +++ b/Docs/Workflows/Productivity/MarkdownLinting.md @@ -0,0 +1,16 @@ +# Markdown Linting + +This workflow uses [`markdownlint-cli2`](https://github.com/DavidAnson/markdownlint-cli2) through its wrapper action for linting markdown files according to an optional configuration file. Such a configuration file includes a set of rules that are checked against when linting the files and can be found in `../../../.github/actions/markdown-lint/lombiq.markdownlint.json` and is used by default. + +You would typically consume the corresponding GHA workflow for markdown linting like this: + +```yaml +... + +jobs: + markdown-linting: + name: Markdown Linting + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev +``` + +The list of input parameters specific to the behavior of `markdownlint` are the the same as its wrapper action and [described in its readme](https://github.com/DavidAnson/markdownlint-cli2-action?tab=readme-ov-file#inputs). The values are passed on directly, but the defaults are changed to use Lombiq's configuration file. diff --git a/Docs/Workflows/Productivity/YamlLinting.md b/Docs/Workflows/Productivity/YamlLinting.md index 82d14587d..d43ff8290 100644 --- a/Docs/Workflows/Productivity/YamlLinting.md +++ b/Docs/Workflows/Productivity/YamlLinting.md @@ -1,6 +1,6 @@ # YAML Linting -This solution uses [`yamllint`](https://github.com/adrienverge/yamllint) for linting YAML files according to a configuration file. Such a configuration file includes a set of rules that are checked against when linting the files and can be found in `/.trunk/configs/.yamllint.yaml`. +This workflow uses [`yamllint`](https://github.com/adrienverge/yamllint) for linting YAML files according to a configuration file. Such a configuration file includes a set of rules that are checked against when linting the files and can be found in `/.trunk/configs/.yamllint.yaml`. You would typically consume the corresponding GHA workflow for YAML linting like this: From 8399fda4aacd376d6924568f316ffa8956b1dedd Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:05:59 +0200 Subject: [PATCH 02/39] Updating spelling dictionary and workflow references --- .github/actions/spelling/dictionaries/Lombiq.common.txt | 1 + .github/workflows/markdown-lint-this-repo.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/spelling-this-repo.yml | 2 +- .github/workflows/yaml-lint.yml | 8 ++++++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/spelling/dictionaries/Lombiq.common.txt b/.github/actions/spelling/dictionaries/Lombiq.common.txt index c1049bde0..6af2e7967 100644 --- a/.github/actions/spelling/dictionaries/Lombiq.common.txt +++ b/.github/actions/spelling/dictionaries/Lombiq.common.txt @@ -71,6 +71,7 @@ linting loglevel lombiq lucene +markdownlint mediafield mediatheme mentoring diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index bb1690d8c..5b1a4a39a 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -10,4 +10,4 @@ on: jobs: markdown-linting: name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 9693a14a0..4fad0b303 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -80,7 +80,7 @@ jobs: git commit -m 'stub commit -- includes submodules' - name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@dev + uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@issue/OSOE-744 with: config: ${{ inputs.config }} fix: ${{ inputs.fix }} diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index cc1d2dd9b..5c8d36a15 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -11,7 +11,7 @@ on: jobs: spelling: name: Spelling - uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@issue/OSOE-744 with: additional-dictionaries: | cspell:companies/src/companies.txt diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 820076307..00ace3f7d 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -19,7 +19,7 @@ on: description: If set to "true", this will cancel the current workflow run with all jobs if this workflow fails. required: false type: string - default: "true" + default: 'true' config-file-path: description: 'Path to the yamllint configuration file' required: true @@ -43,7 +43,7 @@ jobs: token: ${{ secrets.CHECKOUT_TOKEN }} - name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/actions/yaml-lint@dev + uses: Lombiq/GitHub-Actions/.github/actions/yaml-lint@issue/OSOE-744 with: config-file-path: ${{ inputs.config-file-path }} search-path: ${{ inputs.search-path }} @@ -53,3 +53,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + markdown-linting: + name: Markdown Linting + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 From eb24156b923493394ca6e7cc9f173c7f1df00980 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:09:04 +0200 Subject: [PATCH 03/39] Updating configuration and workflow references --- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/spelling.yml | 2 +- .github/workflows/yaml-lint-this-repo.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 4fad0b303..f45e8322b 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -39,7 +39,7 @@ on: config: description: Path to a file to use for the base configuration object (defaults to "lombiq.markdownlint.json"). type: string - default: '../actions/markdown-lint/lombiq.markdownlint.json' + default: '.github/actions/markdown-lint/lombiq.markdownlint.json' fix: description: Whether to fix issues automatically for the rules that support it (any truthy value enables). type: string diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 0348e9230..56a56b0aa 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -111,7 +111,7 @@ jobs: - name: Check Spelling id: check-spelling-action - uses: Lombiq/GitHub-Actions/.github/actions/spelling@dev + uses: Lombiq/GitHub-Actions/.github/actions/spelling@issue/OSOE-744 with: merge-file-excludes: ${{ inputs.merge-file-excludes }} merge-forbidden-patterns: ${{ inputs.merge-forbidden-patterns }} diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index beca90419..d71d76efa 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: yaml-linting: name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@issue/OSOE-744 with: config-file-path: '.trunk/configs/.yamllint.yaml' search-path: '.' From 4d749e8979ef88b6a628e410106485e22ef418a5 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:15:15 +0200 Subject: [PATCH 04/39] Updating markdown-lint-this-repo parameters to exclude License.md --- .github/workflows/markdown-lint-this-repo.yml | 3 +++ .github/workflows/yaml-lint.yml | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index 5b1a4a39a..1bd8da1b0 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -11,3 +11,6 @@ jobs: markdown-linting: name: Markdown Linting uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 + with: + globs: '*.{md,markdown};!License.md' + separator: ';' diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 00ace3f7d..fe4c58f81 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -53,7 +53,3 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - markdown-linting: - name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 From c273b76a63c7cdce5377a35ab0e857c60d8209e4 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:21:32 +0200 Subject: [PATCH 05/39] Fixing temporary spelling configuration --- .github/workflows/spelling-this-repo.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index 5c8d36a15..fc4fb0556 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -15,3 +15,7 @@ jobs: with: additional-dictionaries: | cspell:companies/src/companies.txt + additional-configuration-source-prefixes: > + { + 'lombiq-lgha' = 'https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/', + } From 3c9b08121c09800f19cfc2986a2ba3b1edcb2281 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:24:04 +0200 Subject: [PATCH 06/39] Fixing temporary spelling configuration again --- .github/workflows/spelling-this-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index fc4fb0556..57939af0d 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -17,5 +17,5 @@ jobs: cspell:companies/src/companies.txt additional-configuration-source-prefixes: > { - 'lombiq-lgha' = 'https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/', + "lombiq-lgha" = "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/" } From 30b2e9f3dbcc3fc6d538a1f92ca18f1a58f2e688 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:33:04 +0200 Subject: [PATCH 07/39] I really should RTFM I wrote --- .github/workflows/spelling-this-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index 57939af0d..6b795044f 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -17,5 +17,5 @@ jobs: cspell:companies/src/companies.txt additional-configuration-source-prefixes: > { - "lombiq-lgha" = "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/" + "lombiq-lgha": "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/" } From f2b2871d1de63aa627a5c6b04a30e3c9317f498e Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:36:10 +0200 Subject: [PATCH 08/39] Updating markdown file detection glob --- .github/actions/markdown-lint/action.yml | 2 +- .github/workflows/markdown-lint-this-repo.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index d712d3f23..405af9485 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -15,7 +15,7 @@ inputs: required: false globs: description: Glob expression(s) of files to lint (newline-delimited). - default: '*.{md,markdown}' + default: '**/*.{md,markdown}' required: false separator: description: String to use as a separator for the "globs" input (defaults to newline). diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index 1bd8da1b0..b9ba2a2db 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -12,5 +12,5 @@ jobs: name: Markdown Linting uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 with: - globs: '*.{md,markdown};!License.md' + globs: '**/*.{md,markdown};!License.md' separator: ';' diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index f45e8322b..b40e46a5b 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -47,7 +47,7 @@ on: globs: description: Glob expression(s) of files to lint (newline-delimited). type: string - default: '*.{md,markdown}' + default: '**/*.{md,markdown}' separator: description: String to use as a separator for the "globs" input (defaults to newline). type: string From 07aa3f942499cc6b60d0588cda9a20d2647e8f0e Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:46:43 +0200 Subject: [PATCH 09/39] Testing error detection by changing the configuration file --- .github/actions/markdown-lint/lombiq.markdownlint.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index 7970d5e73..109957107 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -10,9 +10,9 @@ ] }, "MD049": { - "style": "underscore" + "style": "asterisk" }, "MD050": { - "style": "asterisk" + "style": "underscore" } } From 16be0867d39197aafd166b7242dfec139144a826 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:50:40 +0200 Subject: [PATCH 10/39] Removing concurrency configuration from the markdown-lint workflow, because it's unnecessary due to how fast it completes --- .github/workflows/markdown-lint.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index b40e46a5b..0ada22f6b 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -1,20 +1,5 @@ name: Markdown Linting -concurrency: - # If "cancel-in-progress-for-this-pr" is set to "true" and this is running for a pull request, then the concurrency - # key will be constructed from the name of the workflow and the branch name, causing the already running job in this - # workflow for this pull request to be cancelled. Otherwise it will be the ID of the workflow run, making it globally - # unique and not cancel anything. Concurrency is defined for the whole workflow, because it has only one job. A - # technical name for this workflow is also included in both cases, so that it doesn't come into conflict with other - # jobs calling a different workflow that are started by the same caller workflow. - group: | - ${{ - inputs.cancel-in-progress-for-this-pr == 'true' && github.event_name == 'pull_request' - && format('{0}_markdown-lint_{1}', github.workflow, github.ref) - || format('{0}_markdown-lint', github.run_id) - }} - cancel-in-progress: ${{ inputs.cancel-in-progress-for-this-pr == 'true' }} - on: workflow_call: secrets: @@ -26,12 +11,6 @@ on: # When updating defaults here also update them in the `markdown-lint` action. inputs: - cancel-in-progress-for-this-pr: - description: > - When set to "true", it will cancel the already running workflow for this pull request. See the concurrency - settings of the workflow above for more details. - type: string - default: 'true' cancel-workflow-on-failure: description: When set to "true", it will cancel the current workflow run with all jobs if this workflow fails. type: string @@ -54,7 +33,7 @@ on: default: "\n" timeout-minutes: type: number - default: 3 + default: 1 description: Configuration for the timeout-minutes parameter of the workflow. jobs: From 1b7b4cfa760d3149afeab533bcd145e89e6a9625 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 17 May 2024 20:50:46 +0200 Subject: [PATCH 11/39] Revert "Testing error detection by changing the configuration file" This reverts commit 07aa3f942499cc6b60d0588cda9a20d2647e8f0e. --- .github/actions/markdown-lint/lombiq.markdownlint.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index 109957107..7970d5e73 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -10,9 +10,9 @@ ] }, "MD049": { - "style": "asterisk" + "style": "underscore" }, "MD050": { - "style": "underscore" + "style": "asterisk" } } From 5201b25f563ff3d7b2cea2d2e5cf1581269b32a1 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 24 May 2024 14:10:22 +0200 Subject: [PATCH 12/39] Upgrading markdownlint-cli2-action to v16.0.0 (markdownlint v0.34.0) --- .github/actions/markdown-lint/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 405af9485..4a93f4048 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -26,7 +26,7 @@ runs: using: 'composite' steps: - name: Markdown Linting - uses: DavidAnson/markdownlint-cli2-action@3aaa38e446fbd2c288af4291aa0f55d64651050f # v12.0.0 + uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ${{ inputs.config }} fix: ${{ inputs.fix }} From 574c7dcd4062105937aba67226630146792154f4 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Fri, 24 May 2024 14:54:52 +0200 Subject: [PATCH 13/39] Adding comments about keeping markdownlint and its configuration in sync with Lombiq.NodeJs.Extensions --- .github/actions/markdown-lint/action.yml | 1 + .../markdown-lint/lombiq.markdownlint.json | 22 ++++++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 4a93f4048..f4710b2eb 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -26,6 +26,7 @@ runs: using: 'composite' steps: - name: Markdown Linting + # When upgrading, also update Lombiq.NodeJs.Extensions to use the corresponding version of the markdownlint package. uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ${{ inputs.config }} diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index 7970d5e73..5a86c8e41 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -1,18 +1,10 @@ +// When updating, also update the same configuration file in Lombiq.NodeJs.Extensions. { "default": true, - "MD004": { - "style": "dash" - }, + "MD004": { "style": "dash" }, "MD013": false, - "MD033": { - "allowed_elements": [ - "kbd" - ] - }, - "MD049": { - "style": "underscore" - }, - "MD050": { - "style": "asterisk" - } -} + "MD033": { "allowed_elements": [ "kbd" ] }, + "MD049": { "style": "underscore" }, + "MD050": { "style": "asterisk" } + } + \ No newline at end of file From 951a1a92c6f79cf7d9d5a0f3efd1d04b38633d97 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 12:55:53 +0200 Subject: [PATCH 14/39] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sára El-Saig --- .github/actions/markdown-lint/action.yml | 2 +- .github/actions/markdown-lint/lombiq.markdownlint.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index f4710b2eb..fee0e10cc 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -26,7 +26,7 @@ runs: using: 'composite' steps: - name: Markdown Linting - # When upgrading, also update Lombiq.NodeJs.Extensions to use the corresponding version of the markdownlint package. + # When upgrading, also update Lombiq.NodeJs.Extensions to use the corresponding version of the markdownlint package. uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ${{ inputs.config }} diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index 5a86c8e41..ed97e3955 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -6,5 +6,4 @@ "MD033": { "allowed_elements": [ "kbd" ] }, "MD049": { "style": "underscore" }, "MD050": { "style": "asterisk" } - } - \ No newline at end of file + } \ No newline at end of file From fa928508625fb2588316a3dbe459f7a0fe48b4bc Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 13:09:10 +0200 Subject: [PATCH 15/39] Fixing PowerShell syntax in the spelling workflow --- .github/workflows/spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 56a56b0aa..e3325ff51 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -104,7 +104,7 @@ jobs: run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" - Remove-Item .\.git\ -recurse -force + Remove-Item .\.git\ -Recurse -Force git init . git add . git commit -m 'stub commit -- includes submodules' From 63ebd425af6cbe5ef73bb09b5eb9c3fef8f891cc Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 13:11:26 +0200 Subject: [PATCH 16/39] Removing "Stub repo layout" step from the markdown-lint workflow to check if it's really needed --- .github/workflows/markdown-lint.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 0ada22f6b..ec08232aa 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -47,17 +47,6 @@ jobs: with: token: ${{ secrets.CHECKOUT_TOKEN }} - # This is a workaround to be able to check submodules too in the repository. - - name: Stub repo layout - shell: pwsh - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - Remove-Item .\.git\ -recurse -force - git init . - git add . - git commit -m 'stub commit -- includes submodules' - - name: Markdown Linting uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@issue/OSOE-744 with: From d3c121dfda25cb22492c04b679be571dfd2a5337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Tue, 28 May 2024 13:20:01 +0200 Subject: [PATCH 17/39] Update lombiq.markdownlint.json --- .github/actions/markdown-lint/lombiq.markdownlint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index ed97e3955..1745e6775 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -6,4 +6,4 @@ "MD033": { "allowed_elements": [ "kbd" ] }, "MD049": { "style": "underscore" }, "MD050": { "style": "asterisk" } - } \ No newline at end of file + } From 6d3a1c5e6a2f6d033bcdd55a6a6dff063a1ade7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Tue, 28 May 2024 13:20:29 +0200 Subject: [PATCH 18/39] Fix spacing in lombiq.markdownlint.json --- .github/actions/markdown-lint/lombiq.markdownlint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/lombiq.markdownlint.json b/.github/actions/markdown-lint/lombiq.markdownlint.json index 1745e6775..0fa4eeb9f 100644 --- a/.github/actions/markdown-lint/lombiq.markdownlint.json +++ b/.github/actions/markdown-lint/lombiq.markdownlint.json @@ -6,4 +6,4 @@ "MD033": { "allowed_elements": [ "kbd" ] }, "MD049": { "style": "underscore" }, "MD050": { "style": "asterisk" } - } +} From a2cdb52a0b6f13da45f0b3bee554b77c7fa37b27 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 13:23:08 +0200 Subject: [PATCH 19/39] Configuration to use markdown-lint automatic fixes --- .github/workflows/markdown-lint-this-repo.yml | 1 + .github/workflows/markdown-lint.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index b9ba2a2db..afc79a1f0 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -14,3 +14,4 @@ jobs: with: globs: '**/*.{md,markdown};!License.md' separator: ';' + fix: true diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index ec08232aa..79080fd0c 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -54,6 +54,9 @@ jobs: fix: ${{ inputs.fix }} globs: ${{ inputs.globs }} separator: ${{ inputs.separator }} + + - name: List files updated by markdown-lint automatic fixes + run: git diff --name-only - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' From 1c640e083a079f52f324846a30448754981e1a78 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 13:25:24 +0200 Subject: [PATCH 20/39] Braking some markdown syntax to be fixed --- Docs/SpellCheckingConfiguration.md | 14 +++++++------- Docs/Workflows.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Docs/SpellCheckingConfiguration.md b/Docs/SpellCheckingConfiguration.md index b6a38c016..d2c4d9c87 100644 --- a/Docs/SpellCheckingConfiguration.md +++ b/Docs/SpellCheckingConfiguration.md @@ -17,12 +17,12 @@ When integrating spell-checking to your project for the first time or working on [Configuration files](https://github.com/check-spelling/check-spelling/wiki/Configuration#files) allow you to define words and patterns that shouldn't be considered spelling mistakes, e.g.: -- _allow.txt_: Normal, expected words that just simply weren't added to the base or other referenced dictionary files yet. -- _excludes.txt_: Perl-style regexes to ignore specific paths, files or extensions. -- _expect.txt_: Dictionary file of arbitrary strings that aren't words, but otherwise valid and aren't spelling mistakes. -- _patterns.txt_: Technical strings that aren't made up of words or word stems but follow a certain structure or pattern can be skipped using Perl-styled regexes. Some technical strings are already covered in Lombiq's version, such as hex color codes, Git commit hashes, GUIDs, and more. +- *allow.txt*: Normal, expected words that just simply weren't added to the base or other referenced dictionary files yet. +- *excludes.txt*: Perl-style regexes to ignore specific paths, files or extensions. +- *expect.txt*: Dictionary file of arbitrary strings that aren't words, but otherwise valid and aren't spelling mistakes. +- *patterns.txt*: Technical strings that aren't made up of words or word stems but follow a certain structure or pattern can be skipped using Perl-styled regexes. Some technical strings are already covered in Lombiq's version, such as hex color codes, Git commit hashes, GUIDs, and more. -You can provide these files in your own repository and by default they must be placed under the path _.github/actions/spelling_ (configurable through the action/workflow). To ease maintaining dictionary files (and keep a consistent behavior), keep the entries sorted alphabetically. +You can provide these files in your own repository and by default they must be placed under the path *.github/actions/spelling* (configurable through the action/workflow). To ease maintaining dictionary files (and keep a consistent behavior), keep the entries sorted alphabetically. ## Tips for external dictionaries @@ -46,8 +46,8 @@ Before adding an entry to one of the dictionary files, consider the following: When using custom dictionary files on top of external ones (such as the ones from [check-spelling](https://github.com/check-spelling/cspell-dicts/tree/master) or [Lombiq's](../.github/actions/spelling)), these scripts can help reducing the number of entries you need to add to your own: -- _Merge-SpellCheckingDictionaryFile.ps1_: Use this to maintain your _excludes.txt_ file by adding the entries from another file, while still keeping your own. To just remove duplicates and sort the entries alphabetically in a single configuration file, pass in the same file for both parameters. -- _Optimize-SpellCheckingDictionaryFile.ps1_: Use this to remove entries from your dictionary files that are already present in an external one you're referencing. +- *Merge-SpellCheckingDictionaryFile.ps1*: Use this to maintain your *excludes.txt* file by adding the entries from another file, while still keeping your own. To just remove duplicates and sort the entries alphabetically in a single configuration file, pass in the same file for both parameters. +- *Optimize-SpellCheckingDictionaryFile.ps1*: Use this to remove entries from your dictionary files that are already present in an external one you're referencing. ## Working with a non-dev branch of `Lombiq.GitHub.Actions` diff --git a/Docs/Workflows.md b/Docs/Workflows.md index ee1f7ea8d..e59aac9f8 100644 --- a/Docs/Workflows.md +++ b/Docs/Workflows.md @@ -5,7 +5,7 @@ These workflows can be invoked from a step from any other repository's workflow. ## General notes - In addition to the short explanations and samples, check out the inline documentation of the workflow you want to use, especially its parameters. Those examples don't necessarily utilize all parameters. -- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. _.github/workflows/build-and-test.yml_ and/or _.github/workflows/publish-nuget.yml_. The examples below are for such files. +- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. *.github/workflows/build-and-test.yml* and/or *.github/workflows/publish-nuget.yml*. The examples below are for such files. - If you use these workflows with a self-hosted runner, then you'll need to fork this repository under the organization while keeping [these rules](https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-to-reusable-workflows) in mind. Then, you need to enable workflows for the fork under its Actions tab (you'll see a big button for this). If you don't do the latter step, you'll get a "workflow was not found" error. Then you can also disable the `spelling-this-repo` and `validate-this-gha-refs` workflows, not to run them unnecessarily if you sync the fork with the original repo. ## Saving on computing resources From 3e36dcc01d190feddd7e38d0e1f1b9a5ebd2812c Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 13:27:44 +0200 Subject: [PATCH 21/39] Removing trailing spaces from the markdown-lint workflow --- .github/workflows/markdown-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 79080fd0c..803e58b53 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -54,7 +54,7 @@ jobs: fix: ${{ inputs.fix }} globs: ${{ inputs.globs }} separator: ${{ inputs.separator }} - + - name: List files updated by markdown-lint automatic fixes run: git diff --name-only From e8434809ff75e70d11c7c477dcb26f5428f50ca3 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 15:17:14 +0200 Subject: [PATCH 22/39] Testing the artifact upload of files fixed by markdown-lint --- .github/workflows/markdown-lint.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 803e58b53..4ee704fce 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -41,6 +41,9 @@ jobs: name: Markdown Linting runs-on: ubuntu-22.04 timeout-minutes: ${{ inputs.timeout-minutes }} + defaults: + run: + shell: pwsh steps: - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev @@ -55,8 +58,31 @@ jobs: globs: ${{ inputs.globs }} separator: ${{ inputs.separator }} + - name: Setup Scripts + shell: pwsh + run: | + "${{ github.action_path }}" >> $Env:GITHUB_PATH + (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + - name: List files updated by markdown-lint automatic fixes - run: git diff --name-only + if: inputs.fix == 'true' + id: markdown-lint-fix-files + run: | + $files = ConvertFrom-MultiLineStringToStringArray -Lines (git diff --name-only '*.md' '*.markdown') + Set-GitHubOutput 'files' $files + + - name: Upload files fixed by markdown-lint + uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + with: + name: markdown-lint-fixed-files + path: steps.markdown-lint-fix-files.outputs.files + if-no-files-found: warn + retention-days: 1 + + - name: Fail workflow if markdown-lint fixes were made + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + run: exit 1 - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' From a5847ac153f16967c5866f090b30a631712d71a5 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 15:26:47 +0200 Subject: [PATCH 23/39] Moving custom logic from workflow to action --- .github/actions/markdown-lint/action.yml | 26 +++++++++++++++++++++ .github/workflows/markdown-lint.yml | 29 ------------------------ 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index fee0e10cc..91b8767ef 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -33,3 +33,29 @@ runs: fix: ${{ inputs.fix }} globs: ${{ inputs.globs }} separator: ${{ inputs.separator }} + + - name: Setup Scripts + shell: pwsh + run: (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + + - name: List files updated by markdown-lint automatic fixes + if: inputs.fix == 'true' + id: markdown-lint-fix-files + shell: pwsh + run: | + $files = ConvertFrom-MultiLineStringToStringArray -Lines (git diff --name-only '*.md' '*.markdown') + Set-GitHubOutput 'files' $files + + - name: Upload files fixed by markdown-lint + uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + with: + name: markdown-lint-fixed-files + path: steps.markdown-lint-fix-files.outputs.files + if-no-files-found: warn + retention-days: 1 + + - name: Fail workflow if markdown-lint fixes were made + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + shell: pwsh + run: exit 1 diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 4ee704fce..ec08232aa 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -41,9 +41,6 @@ jobs: name: Markdown Linting runs-on: ubuntu-22.04 timeout-minutes: ${{ inputs.timeout-minutes }} - defaults: - run: - shell: pwsh steps: - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev @@ -58,32 +55,6 @@ jobs: globs: ${{ inputs.globs }} separator: ${{ inputs.separator }} - - name: Setup Scripts - shell: pwsh - run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH - - - name: List files updated by markdown-lint automatic fixes - if: inputs.fix == 'true' - id: markdown-lint-fix-files - run: | - $files = ConvertFrom-MultiLineStringToStringArray -Lines (git diff --name-only '*.md' '*.markdown') - Set-GitHubOutput 'files' $files - - - name: Upload files fixed by markdown-lint - uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev - if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' - with: - name: markdown-lint-fixed-files - path: steps.markdown-lint-fix-files.outputs.files - if-no-files-found: warn - retention-days: 1 - - - name: Fail workflow if markdown-lint fixes were made - if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' - run: exit 1 - - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev From 195c51e23c39d7ae2fa10da877f84645c504ab89 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 15:34:31 +0200 Subject: [PATCH 24/39] Fixing syntax --- .github/actions/markdown-lint/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 91b8767ef..e3964bedd 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -51,11 +51,13 @@ runs: if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' with: name: markdown-lint-fixed-files - path: steps.markdown-lint-fix-files.outputs.files + path: ${{ steps.markdown-lint-fix-files.outputs.files }} if-no-files-found: warn retention-days: 1 - name: Fail workflow if markdown-lint fixes were made if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' shell: pwsh - run: exit 1 + run: | + Write-Warning '${{ steps.markdown-lint-fix-files.outputs.files }}' + exit 1 From a154978384caa89230a9408866add8ae2cf6919b Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 15:36:59 +0200 Subject: [PATCH 25/39] Attempting to fix artifact upload --- .github/actions/markdown-lint/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index e3964bedd..8406ef13f 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -51,7 +51,8 @@ runs: if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' with: name: markdown-lint-fixed-files - path: ${{ steps.markdown-lint-fix-files.outputs.files }} + path: | + ${{ steps.markdown-lint-fix-files.outputs.files }} if-no-files-found: warn retention-days: 1 From f213092530fc83404aa1b14431e5a3e36d41fb2d Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 15:54:11 +0200 Subject: [PATCH 26/39] Updating error output --- .github/actions/markdown-lint/action.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 8406ef13f..8cb4db660 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -51,14 +51,11 @@ runs: if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' with: name: markdown-lint-fixed-files - path: | - ${{ steps.markdown-lint-fix-files.outputs.files }} + path: ${{ steps.markdown-lint-fix-files.outputs.files }} if-no-files-found: warn retention-days: 1 - name: Fail workflow if markdown-lint fixes were made if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' shell: pwsh - run: | - Write-Warning '${{ steps.markdown-lint-fix-files.outputs.files }}' - exit 1 + run: Write-Output '::error::Markdown linting fixes were applied and the modified files are available as artifacts.' From 1b0d75f4c22fd36aabd02edf04bcf5d6dc63dd9b Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 16:02:15 +0200 Subject: [PATCH 27/39] Updating error output --- .github/actions/markdown-lint/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 8cb4db660..ab12a9b1a 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -58,4 +58,6 @@ runs: - name: Fail workflow if markdown-lint fixes were made if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' shell: pwsh - run: Write-Output '::error::Markdown linting fixes were applied and the modified files are available as artifacts.' + run: | + Write-Output '::error::The following files were modified by "markdown-lint" and are available to download as artifacts:`n${{ steps.markdown-lint-fix-files.outputs.files}}' + exit 1 From 3c0831d242278de3ac0f5d317c9b56306da59ce4 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Tue, 28 May 2024 16:06:24 +0200 Subject: [PATCH 28/39] Fixing error output --- .github/actions/markdown-lint/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index ab12a9b1a..ac102601a 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -59,5 +59,5 @@ runs: if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' shell: pwsh run: | - Write-Output '::error::The following files were modified by "markdown-lint" and are available to download as artifacts:`n${{ steps.markdown-lint-fix-files.outputs.files}}' + Write-Output '::error::The following files were modified by markdown-lint and are available to download as artifacts: ${{ steps.markdown-lint-fix-files.outputs.files}}' exit 1 From b930abbe223de0c928c1da84ba3e85a691aba744 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 17:23:17 +0200 Subject: [PATCH 29/39] Reverting Docs/Workflows.md to test artifact upload if there's only one file violating rules --- Docs/Workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Workflows.md b/Docs/Workflows.md index e59aac9f8..ee1f7ea8d 100644 --- a/Docs/Workflows.md +++ b/Docs/Workflows.md @@ -5,7 +5,7 @@ These workflows can be invoked from a step from any other repository's workflow. ## General notes - In addition to the short explanations and samples, check out the inline documentation of the workflow you want to use, especially its parameters. Those examples don't necessarily utilize all parameters. -- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. *.github/workflows/build-and-test.yml* and/or *.github/workflows/publish-nuget.yml*. The examples below are for such files. +- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. _.github/workflows/build-and-test.yml_ and/or _.github/workflows/publish-nuget.yml_. The examples below are for such files. - If you use these workflows with a self-hosted runner, then you'll need to fork this repository under the organization while keeping [these rules](https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-to-reusable-workflows) in mind. Then, you need to enable workflows for the fork under its Actions tab (you'll see a big button for this). If you don't do the latter step, you'll get a "workflow was not found" error. Then you can also disable the `spelling-this-repo` and `validate-this-gha-refs` workflows, not to run them unnecessarily if you sync the fork with the original repo. ## Saving on computing resources From 3b2d3e48ad9be0860bcfd9f532e763137d648393 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 17:26:29 +0200 Subject: [PATCH 30/39] Disabling some of the workflows for now --- .github/workflows/spelling-this-repo.yml | 2 +- .github/workflows/validate-this-gha-refs.yml | 2 +- .github/workflows/yaml-lint-this-repo.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index 6b795044f..41083a185 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -3,7 +3,7 @@ name: Spelling # is meant to actually run here, so don't call it from other repos. on: - pull_request: + # pull_request: push: branches: - dev diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index e822df0d4..29343c563 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -3,7 +3,7 @@ on: push: branches: - dev - pull_request: + # pull_request: pull_request_review: types: [submitted] merge_group: diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index d71d76efa..a9d9d8712 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -2,7 +2,7 @@ name: YAML Linting # Runs for PRs opened for any branch, and pushes to the dev branch. on: - pull_request: + # pull_request: push: branches: - dev From a7dc08a42f32919b11db200e1445bee19030264c Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:45:57 +0200 Subject: [PATCH 31/39] Updating markdown-lint action to upload fixed files while keeping their folder structure --- .github/actions/markdown-lint/action.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index ac102601a..d74b103b0 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -38,26 +38,33 @@ runs: shell: pwsh run: (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH - - name: List files updated by markdown-lint automatic fixes + - name: Copy files updated by markdown-lint automatic fixes if: inputs.fix == 'true' id: markdown-lint-fix-files shell: pwsh run: | - $files = ConvertFrom-MultiLineStringToStringArray -Lines (git diff --name-only '*.md' '*.markdown') - Set-GitHubOutput 'files' $files + $artifactFolder = [System.Guid]::NewGuid() + $files = git diff --name-only '*.md' '*.markdown' + $files | ForEach-Object { + $destination = "$artifactFolder/$PSItem" + New-Item -ItemType File -Path $destination -Force + Copy-Item -Path $PSItem -Destination $destination -Force + } + + Set-GitHubOutput 'has-fixes' ($files.Length -gt 0).ToString().ToLower() + Set-GitHubOutput 'artifact-path' $artifactFolder - name: Upload files fixed by markdown-lint uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev - if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.has-fixes == 'true' with: name: markdown-lint-fixed-files - path: ${{ steps.markdown-lint-fix-files.outputs.files }} - if-no-files-found: warn + path: ${{ steps.markdown-lint-fix-files.outputs.artifact-path }} retention-days: 1 - name: Fail workflow if markdown-lint fixes were made - if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.files != '' + if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.has-fixes == 'true' shell: pwsh run: | - Write-Output '::error::The following files were modified by markdown-lint and are available to download as artifacts: ${{ steps.markdown-lint-fix-files.outputs.files}}' + Write-Output '::error::Some files were modified by markdown-lint and are available to download as artifacts.' exit 1 From 766ce37a10cb7ac6dc0f51b61b8479403a181aca Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:47:17 +0200 Subject: [PATCH 32/39] Revert "Reverting Docs/Workflows.md to test artifact upload if there's only one file violating rules" This reverts commit b930abbe223de0c928c1da84ba3e85a691aba744. --- Docs/Workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Workflows.md b/Docs/Workflows.md index ee1f7ea8d..e59aac9f8 100644 --- a/Docs/Workflows.md +++ b/Docs/Workflows.md @@ -5,7 +5,7 @@ These workflows can be invoked from a step from any other repository's workflow. ## General notes - In addition to the short explanations and samples, check out the inline documentation of the workflow you want to use, especially its parameters. Those examples don't necessarily utilize all parameters. -- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. _.github/workflows/build-and-test.yml_ and/or _.github/workflows/publish-nuget.yml_. The examples below are for such files. +- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. *.github/workflows/build-and-test.yml* and/or *.github/workflows/publish-nuget.yml*. The examples below are for such files. - If you use these workflows with a self-hosted runner, then you'll need to fork this repository under the organization while keeping [these rules](https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-to-reusable-workflows) in mind. Then, you need to enable workflows for the fork under its Actions tab (you'll see a big button for this). If you don't do the latter step, you'll get a "workflow was not found" error. Then you can also disable the `spelling-this-repo` and `validate-this-gha-refs` workflows, not to run them unnecessarily if you sync the fork with the original repo. ## Saving on computing resources From 6f5378853d219d1cd3aff3d8857387832f11404e Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:49:04 +0200 Subject: [PATCH 33/39] Breaking .github/actions/spelling/advice.md too --- .github/actions/spelling/advice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index a76a191c8..42f62e89d 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,5 +1,5 @@ # Spell-checking configuration advice -What to do with false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. +*What to do with* false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. For further details, please read [our recommendations for maintaining the spell-checking configuration](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/SpellCheckingConfiguration.md) carefully! From 7d0dca2eb9e89a8ba456f92447c5e0213e24d26c Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:50:22 +0200 Subject: [PATCH 34/39] Committing files fixed automatically by markdown-lint --- .github/actions/spelling/advice.md | 2 +- Docs/SpellCheckingConfiguration.md | 14 +++++++------- Docs/Workflows.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index 42f62e89d..d6d01bb47 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,5 +1,5 @@ # Spell-checking configuration advice -*What to do with* false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. +_What to do with_ false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. For further details, please read [our recommendations for maintaining the spell-checking configuration](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/SpellCheckingConfiguration.md) carefully! diff --git a/Docs/SpellCheckingConfiguration.md b/Docs/SpellCheckingConfiguration.md index d2c4d9c87..b6a38c016 100644 --- a/Docs/SpellCheckingConfiguration.md +++ b/Docs/SpellCheckingConfiguration.md @@ -17,12 +17,12 @@ When integrating spell-checking to your project for the first time or working on [Configuration files](https://github.com/check-spelling/check-spelling/wiki/Configuration#files) allow you to define words and patterns that shouldn't be considered spelling mistakes, e.g.: -- *allow.txt*: Normal, expected words that just simply weren't added to the base or other referenced dictionary files yet. -- *excludes.txt*: Perl-style regexes to ignore specific paths, files or extensions. -- *expect.txt*: Dictionary file of arbitrary strings that aren't words, but otherwise valid and aren't spelling mistakes. -- *patterns.txt*: Technical strings that aren't made up of words or word stems but follow a certain structure or pattern can be skipped using Perl-styled regexes. Some technical strings are already covered in Lombiq's version, such as hex color codes, Git commit hashes, GUIDs, and more. +- _allow.txt_: Normal, expected words that just simply weren't added to the base or other referenced dictionary files yet. +- _excludes.txt_: Perl-style regexes to ignore specific paths, files or extensions. +- _expect.txt_: Dictionary file of arbitrary strings that aren't words, but otherwise valid and aren't spelling mistakes. +- _patterns.txt_: Technical strings that aren't made up of words or word stems but follow a certain structure or pattern can be skipped using Perl-styled regexes. Some technical strings are already covered in Lombiq's version, such as hex color codes, Git commit hashes, GUIDs, and more. -You can provide these files in your own repository and by default they must be placed under the path *.github/actions/spelling* (configurable through the action/workflow). To ease maintaining dictionary files (and keep a consistent behavior), keep the entries sorted alphabetically. +You can provide these files in your own repository and by default they must be placed under the path _.github/actions/spelling_ (configurable through the action/workflow). To ease maintaining dictionary files (and keep a consistent behavior), keep the entries sorted alphabetically. ## Tips for external dictionaries @@ -46,8 +46,8 @@ Before adding an entry to one of the dictionary files, consider the following: When using custom dictionary files on top of external ones (such as the ones from [check-spelling](https://github.com/check-spelling/cspell-dicts/tree/master) or [Lombiq's](../.github/actions/spelling)), these scripts can help reducing the number of entries you need to add to your own: -- *Merge-SpellCheckingDictionaryFile.ps1*: Use this to maintain your *excludes.txt* file by adding the entries from another file, while still keeping your own. To just remove duplicates and sort the entries alphabetically in a single configuration file, pass in the same file for both parameters. -- *Optimize-SpellCheckingDictionaryFile.ps1*: Use this to remove entries from your dictionary files that are already present in an external one you're referencing. +- _Merge-SpellCheckingDictionaryFile.ps1_: Use this to maintain your _excludes.txt_ file by adding the entries from another file, while still keeping your own. To just remove duplicates and sort the entries alphabetically in a single configuration file, pass in the same file for both parameters. +- _Optimize-SpellCheckingDictionaryFile.ps1_: Use this to remove entries from your dictionary files that are already present in an external one you're referencing. ## Working with a non-dev branch of `Lombiq.GitHub.Actions` diff --git a/Docs/Workflows.md b/Docs/Workflows.md index e59aac9f8..ee1f7ea8d 100644 --- a/Docs/Workflows.md +++ b/Docs/Workflows.md @@ -5,7 +5,7 @@ These workflows can be invoked from a step from any other repository's workflow. ## General notes - In addition to the short explanations and samples, check out the inline documentation of the workflow you want to use, especially its parameters. Those examples don't necessarily utilize all parameters. -- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. *.github/workflows/build-and-test.yml* and/or *.github/workflows/publish-nuget.yml*. The examples below are for such files. +- To add the workflows to a project create a folder in the root of the repository that will call them, e.g. _.github/workflows/build-and-test.yml_ and/or _.github/workflows/publish-nuget.yml_. The examples below are for such files. - If you use these workflows with a self-hosted runner, then you'll need to fork this repository under the organization while keeping [these rules](https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-to-reusable-workflows) in mind. Then, you need to enable workflows for the fork under its Actions tab (you'll see a big button for this). If you don't do the latter step, you'll get a "workflow was not found" error. Then you can also disable the `spelling-this-repo` and `validate-this-gha-refs` workflows, not to run them unnecessarily if you sync the fork with the original repo. ## Saving on computing resources From b935c7e2872d135584b5d3cc5f83e952cb25450f Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:51:32 +0200 Subject: [PATCH 35/39] Revert "Disabling some of the workflows for now" This reverts commit 3b2d3e48ad9be0860bcfd9f532e763137d648393. --- .github/workflows/spelling-this-repo.yml | 2 +- .github/workflows/validate-this-gha-refs.yml | 2 +- .github/workflows/yaml-lint-this-repo.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index 41083a185..6b795044f 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -3,7 +3,7 @@ name: Spelling # is meant to actually run here, so don't call it from other repos. on: - # pull_request: + pull_request: push: branches: - dev diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index 29343c563..e822df0d4 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -3,7 +3,7 @@ on: push: branches: - dev - # pull_request: + pull_request: pull_request_review: types: [submitted] merge_group: diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index a9d9d8712..d71d76efa 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -2,7 +2,7 @@ name: YAML Linting # Runs for PRs opened for any branch, and pushes to the dev branch. on: - # pull_request: + pull_request: push: branches: - dev From fb3e3d516e9e6f2c0221f4c239fe7c0b7a1becbf Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 18:55:34 +0200 Subject: [PATCH 36/39] Reverting .github/actions/spelling/advice.md changes --- .github/actions/spelling/advice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index d6d01bb47..a76a191c8 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,5 +1,5 @@ # Spell-checking configuration advice -_What to do with_ false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. +What to do with false positives that aren't actually spelling mistakes? If the word is only used in a few cases, add the `#spell-check-ignore-line` comment to ignore the whole line. For a more common occurrence, add it to the appropriate dictionary file or define a pattern that matches it and similar cases. For further details, please read [our recommendations for maintaining the spell-checking configuration](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/SpellCheckingConfiguration.md) carefully! From 5777a46dade741e3bafd47411546c9a21628d652 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 19:05:35 +0200 Subject: [PATCH 37/39] Fixing .github/actions/markdown-lint/action.yml whitespace --- .github/actions/markdown-lint/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index d74b103b0..085f9c191 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -50,7 +50,7 @@ runs: New-Item -ItemType File -Path $destination -Force Copy-Item -Path $PSItem -Destination $destination -Force } - + Set-GitHubOutput 'has-fixes' ($files.Length -gt 0).ToString().ToLower() Set-GitHubOutput 'artifact-path' $artifactFolder From 095986d1158cd861db460cc61f4b7a8f2bdb0d6a Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 3 Jun 2024 19:22:47 +0200 Subject: [PATCH 38/39] Updating comment about the markdown-lint action's parameters --- .github/actions/markdown-lint/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index 085f9c191..070b3628c 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -3,7 +3,8 @@ description: > Lints markdown files by wrapping the markdownlint-cli2 action (https://github.com/DavidAnson/markdownlint-cli2-action). -# When updating defaults here also update them in the `markdown-lint` workflow. +# When updating defaults here also update them in the `markdown-lint` workflow. These parameters are passed on directly +# to the markdownlint-cli2 action, see: https://github.com/DavidAnson/markdownlint-cli2-action/blob/main/action.yml. inputs: config: description: Path to a file to use for the base configuration object (defaults to "lombiq.markdownlint.json"). @@ -26,7 +27,8 @@ runs: using: 'composite' steps: - name: Markdown Linting - # When upgrading, also update Lombiq.NodeJs.Extensions to use the corresponding version of the markdownlint package. + # When upgrading, also update Lombiq.NodeJs.Extensions to use the corresponding version of the markdownlint + # package. uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ${{ inputs.config }} From 25d094e43a851c6b086f341f034bfb326d8d0ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 5 Jun 2024 13:03:32 +0200 Subject: [PATCH 39/39] revert branch selectors --- .github/workflows/markdown-lint-this-repo.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/spelling-this-repo.yml | 4 ++-- .github/workflows/spelling.yml | 2 +- .github/workflows/yaml-lint-this-repo.yml | 2 +- .github/workflows/yaml-lint.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index afc79a1f0..0da9c27ee 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: markdown-linting: name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev with: globs: '**/*.{md,markdown};!License.md' separator: ';' diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index ec08232aa..8834ddca4 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -48,7 +48,7 @@ jobs: token: ${{ secrets.CHECKOUT_TOKEN }} - name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/actions/markdown-lint@dev with: config: ${{ inputs.config }} fix: ${{ inputs.fix }} diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index 6b795044f..0a0cd4826 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -11,11 +11,11 @@ on: jobs: spelling: name: Spelling - uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev with: additional-dictionaries: | cspell:companies/src/companies.txt additional-configuration-source-prefixes: > { - "lombiq-lgha": "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/issue/OSOE-744/.github/actions/spelling/" + "lombiq-lgha": "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/dev/.github/actions/spelling/" } diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index e3325ff51..8808148f0 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -111,7 +111,7 @@ jobs: - name: Check Spelling id: check-spelling-action - uses: Lombiq/GitHub-Actions/.github/actions/spelling@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/actions/spelling@dev with: merge-file-excludes: ${{ inputs.merge-file-excludes }} merge-forbidden-patterns: ${{ inputs.merge-forbidden-patterns }} diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index d71d76efa..beca90419 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: yaml-linting: name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@dev with: config-file-path: '.trunk/configs/.yamllint.yaml' search-path: '.' diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index fe4c58f81..749776747 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -43,7 +43,7 @@ jobs: token: ${{ secrets.CHECKOUT_TOKEN }} - name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/actions/yaml-lint@issue/OSOE-744 + uses: Lombiq/GitHub-Actions/.github/actions/yaml-lint@dev with: config-file-path: ${{ inputs.config-file-path }} search-path: ${{ inputs.search-path }}