From 4f400c52ad658f9b46e7e29541c69f896b4d0ad4 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 14:53:46 -0600 Subject: [PATCH 01/17] lint: WIP markdown support Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4708110..705d55c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -123,6 +123,13 @@ jobs: version: "${{ inputs.golangci-lint-version }}" working-directory: "${{ inputs.directory }}" + # Markdown + - name: run markdownlint-cli2 + if: inputs.language == 'markdown' + uses: DavidAnson/markdownlint-cli2-action@v9 + with: + globs: '**/*.md' + # Make - name: run lint (make) if: (inputs.language == 'python' && inputs.type == '') || inputs.type == 'make' From fe7519a6de3adc1b3bd9ca2958a9232e1322ea3c Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 16:23:43 -0600 Subject: [PATCH 02/17] configs: mostly default markdownlint config Signed-off-by: William Woodruff --- configs/default.markdownlint.jsonc | 240 +++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 configs/default.markdownlint.jsonc diff --git a/configs/default.markdownlint.jsonc b/configs/default.markdownlint.jsonc new file mode 100644 index 0000000..23563a2 --- /dev/null +++ b/configs/default.markdownlint.jsonc @@ -0,0 +1,240 @@ +{ + // Default state for all rules + "default": true, + // MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time + "MD001": true, + // MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading + "MD002": { + // Heading level + "level": 1 + }, + // MD003/heading-style/header-style - Heading style + "MD003": { + // Heading style + "style": "atx" + }, + // MD004/ul-style - Unordered list style + "MD004": { + // List style + "style": "asterisk" + }, + // MD005/list-indent - Inconsistent indentation for list items at the same level + "MD005": true, + // MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line + "MD006": true, + // MD007/ul-indent - Unordered list indentation + "MD007": { + // Spaces for indent + "indent": 2, + // Whether to indent the first level of the list + "start_indented": false, + // Spaces for first level indent (when start_indented is set) + "start_indent": 2 + }, + // MD009/no-trailing-spaces - Trailing spaces + "MD009": { + // Spaces for line break + "br_spaces": 2, + // Allow spaces for empty lines in list items + "list_item_empty_lines": false, + // Include unnecessary breaks + "strict": false + }, + // MD010/no-hard-tabs - Hard tabs + "MD010": { + // Include code blocks + "code_blocks": true, + // Fenced code languages to ignore + "ignore_code_languages": [ + "make", + "makefile" + ], + // Number of spaces for each hard tab + "spaces_per_tab": 1 + }, + // MD011/no-reversed-links - Reversed link syntax + "MD011": true, + // MD012/no-multiple-blanks - Multiple consecutive blank lines + "MD012": { + // Consecutive blank lines + "maximum": 1 + }, + // MD013/line-length - Line length + "MD013": { + // Number of characters + "line_length": 80, + // Number of characters for headings + "heading_line_length": 80, + // Number of characters for code blocks + "code_block_line_length": 80, + // Include code blocks + "code_blocks": true, + // Include tables + "tables": true, + // Include headings + "headings": true, + // Include headings + "headers": true, + // Strict length checking + "strict": false, + // Stern length checking + "stern": false + }, + // MD014/commands-show-output - Dollar signs used before commands without showing output + "MD014": true, + // MD018/no-missing-space-atx - No space after hash on atx style heading + "MD018": true, + // MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading + "MD019": true, + // MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading + "MD020": true, + // MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading + "MD021": true, + // MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines + "MD022": { + // Blank lines above heading + "lines_above": 1, + // Blank lines below heading + "lines_below": 1 + }, + // MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line + "MD023": true, + // MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content + "MD024": { + // Only check sibling headings + "allow_different_nesting": false, + // Only check sibling headings + "siblings_only": false + }, + // MD025/single-title/single-h1 - Multiple top-level headings in the same document + "MD025": { + // Heading level + "level": 1, + // RegExp for matching title in front matter + "front_matter_title": "^\\s*title\\s*[:=]" + }, + // MD026/no-trailing-punctuation - Trailing punctuation in heading + "MD026": { + // Punctuation characters not allowed at end of headings + "punctuation": ".,;:!。,;:!" + }, + // MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol + "MD027": true, + // MD028/no-blanks-blockquote - Blank line inside blockquote + "MD028": true, + // MD029/ol-prefix - Ordered list item prefix + "MD029": { + // List style + "style": "one_or_ordered" + }, + // MD030/list-marker-space - Spaces after list markers + "MD030": { + // Spaces for single-line unordered list items + "ul_single": 1, + // Spaces for single-line ordered list items + "ol_single": 1, + // Spaces for multi-line unordered list items + "ul_multi": 1, + // Spaces for multi-line ordered list items + "ol_multi": 1 + }, + // MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines + "MD031": { + // Include list items + "list_items": true + }, + // MD032/blanks-around-lists - Lists should be surrounded by blank lines + "MD032": true, + // MD033/no-inline-html - Inline HTML + "MD033": { + // Allowed elements + "allowed_elements": [] + }, + // MD034/no-bare-urls - Bare URL used + "MD034": true, + // MD035/hr-style - Horizontal rule style + "MD035": { + // Horizontal rule style + "style": "consistent" + }, + // MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading + "MD036": { + // Punctuation characters + "punctuation": ".,;:!?。,;:!?" + }, + // MD037/no-space-in-emphasis - Spaces inside emphasis markers + "MD037": true, + // MD038/no-space-in-code - Spaces inside code span elements + "MD038": true, + // MD039/no-space-in-links - Spaces inside link text + "MD039": true, + // MD040/fenced-code-language - Fenced code blocks should have a language specified + "MD040": { + // List of languages + "allowed_languages": [], + // Require language only + "language_only": false + }, + // MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading + "MD041": { + // Heading level + "level": 1, + // RegExp for matching title in front matter + "front_matter_title": "^\\s*title\\s*[:=]" + }, + // MD042/no-empty-links - No empty links + "MD042": true, + // MD043/required-headings/required-headers - Required heading structure + "MD043": { + // List of headings + "headings": [], + // List of headings + "headers": [], + // Match case of headings + "match_case": false + }, + // MD044/proper-names - Proper names should have the correct capitalization + "MD044": { + // List of proper names + "names": [], + // Include code blocks + "code_blocks": true, + // Include HTML elements + "html_elements": true + }, + // MD045/no-alt-text - Images should have alternate text (alt text) + "MD045": true, + // MD046/code-block-style - Code block style + "MD046": { + // Block style + "style": "consistent" + }, + // MD047/single-trailing-newline - Files should end with a single newline character + "MD047": true, + // MD048/code-fence-style - Code fence style + "MD048": { + // Code fence style + "style": "consistent" + }, + // MD049/emphasis-style - Emphasis style should be consistent + "MD049": { + // Emphasis style should be consistent + "style": "consistent" + }, + // MD050/strong-style - Strong style should be consistent + "MD050": { + // Strong style should be consistent + "style": "consistent" + }, + // MD051/link-fragments - Link fragments should be valid + "MD051": true, + // MD052/reference-links-images - Reference links and images should use a label that is defined + "MD052": true, + // MD053/link-image-reference-definitions - Link and image reference definitions should be needed + "MD053": { + // Ignored definitions + "ignored_definitions": [ + "//" + ] + } +} From 61e2f9946cec6ab34f2355dcde85a529c8fdfb64 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 16:31:16 -0600 Subject: [PATCH 03/17] lint: hack the markdownlint config into place Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 705d55c..a215809 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -124,11 +124,24 @@ jobs: working-directory: "${{ inputs.directory }}" # Markdown + - name: download markdownlint config + if: inputs.language == 'markdown' + env: + ACTION_REPO: ${{ github.action_repository }} + ACTION_REF: ${{ github.action_ref }} + # TODO: There is almost certainly a better way to do this. + run: | + config_url="https://raw.githubusercontent.com/${ACTION_REPO}/${ACTION_REF}/configs/default.markdownlint.jsonc" + curl "${config_url}" > /tmp/default.markdownlist.jsonc + - name: run markdownlint-cli2 if: inputs.language == 'markdown' uses: DavidAnson/markdownlint-cli2-action@v9 with: - globs: '**/*.md' + command: config + globs: | + /tmp/default.markdownlint.jsonc + **/*.md # Make - name: run lint (make) From 158c2c18272e55bac90ca37546b53401af101138 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 16:34:45 -0600 Subject: [PATCH 04/17] workflows/lint: hackety hack Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a215809..5809c02 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -42,6 +42,9 @@ on: type: boolean env: + THIS_REPO: ${{ github.action_repo }} + THIS_REF: ${{ github.action_ref }} + # Rust: GitHub Actions supports color codes, so always enable them. CARGO_TERM_COLOR: always @@ -126,12 +129,9 @@ jobs: # Markdown - name: download markdownlint config if: inputs.language == 'markdown' - env: - ACTION_REPO: ${{ github.action_repository }} - ACTION_REF: ${{ github.action_ref }} # TODO: There is almost certainly a better way to do this. run: | - config_url="https://raw.githubusercontent.com/${ACTION_REPO}/${ACTION_REF}/configs/default.markdownlint.jsonc" + config_url="https://raw.githubusercontent.com/${THIS_REPO}/${THIS_REF}/configs/default.markdownlint.jsonc" curl "${config_url}" > /tmp/default.markdownlist.jsonc - name: run markdownlint-cli2 From 7b47019a81f0fff8c9ab01b82035edcf6ba7ae0d Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 16:44:07 -0600 Subject: [PATCH 05/17] lint: hackety hack Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5809c02..8e0da6f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,10 +40,15 @@ on: default: false required: false type: boolean - + internal-action-repo: + default: "${{ github.action_repo }}" + type: string + internal-action-ref: + default: "${{ github.action_ref }}" + type: string env: - THIS_REPO: ${{ github.action_repo }} - THIS_REF: ${{ github.action_ref }} + THIS_REPO: ${{ inputs.internal-action-repo }} + THIS_REF: ${{ inputs.internal-action-ref }} # Rust: GitHub Actions supports color codes, so always enable them. CARGO_TERM_COLOR: always From 29a4b0fff2f213a07117d4e42544fcb2f1661aaf Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 27 Jan 2023 17:16:07 -0600 Subject: [PATCH 06/17] lint: hackety hack Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8e0da6f..4de7a4c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,16 +40,8 @@ on: default: false required: false type: boolean - internal-action-repo: - default: "${{ github.action_repo }}" - type: string - internal-action-ref: - default: "${{ github.action_ref }}" - type: string -env: - THIS_REPO: ${{ inputs.internal-action-repo }} - THIS_REF: ${{ inputs.internal-action-ref }} +env: # Rust: GitHub Actions supports color codes, so always enable them. CARGO_TERM_COLOR: always @@ -60,6 +52,9 @@ env: # the subset of development dependencies installed. INSTALL_EXTRA: lint + THIS_REPO: ${{ github.action_repo }} + THIS_REF: ${{ github.action_ref }} + jobs: lint: runs-on: ubuntu-latest @@ -134,9 +129,11 @@ jobs: # Markdown - name: download markdownlint config if: inputs.language == 'markdown' + env: + THIS_REF: ${{ github.job_workflow_sha }} # TODO: There is almost certainly a better way to do this. run: | - config_url="https://raw.githubusercontent.com/${THIS_REPO}/${THIS_REF}/configs/default.markdownlint.jsonc" + config_url="https://raw.githubusercontent.com/trailofbits/.github/${THIS_REF}/configs/default.markdownlint.jsonc" curl "${config_url}" > /tmp/default.markdownlist.jsonc - name: run markdownlint-cli2 From 5e7d42ff9cc4d06618f32b59c935b421ac919841 Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 14:42:14 -0500 Subject: [PATCH 07/17] checkout org repo --- .github/workflows/lint.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4de7a4c..428930d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -52,14 +52,20 @@ env: # the subset of development dependencies installed. INSTALL_EXTRA: lint - THIS_REPO: ${{ github.action_repo }} - THIS_REF: ${{ github.action_ref }} + ORG_REPO: trailofbits.com/.github + ORG_REPO_REF: ${{ github.job_workflow_sha }} + ORG_REPO_PATH: /tmp/org_github jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: ${ORG_REPO} + ref: ${ORG_REPO_REF} + path: ${ORG_REPO_PATH} # Python - name: configure python, if required @@ -127,22 +133,13 @@ jobs: working-directory: "${{ inputs.directory }}" # Markdown - - name: download markdownlint config - if: inputs.language == 'markdown' - env: - THIS_REF: ${{ github.job_workflow_sha }} - # TODO: There is almost certainly a better way to do this. - run: | - config_url="https://raw.githubusercontent.com/trailofbits/.github/${THIS_REF}/configs/default.markdownlint.jsonc" - curl "${config_url}" > /tmp/default.markdownlist.jsonc - - name: run markdownlint-cli2 if: inputs.language == 'markdown' uses: DavidAnson/markdownlint-cli2-action@v9 with: command: config globs: | - /tmp/default.markdownlint.jsonc + ${ORG_REPO_PATH}/configs/default.markdownlint.jsonc **/*.md # Make From 999d06da8dfb2e44858d73636defa3c5742daf90 Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 14:48:36 -0500 Subject: [PATCH 08/17] fix env syntax --- .github/workflows/lint.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 428930d..a629a70 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -63,9 +63,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: - repository: ${ORG_REPO} - ref: ${ORG_REPO_REF} - path: ${ORG_REPO_PATH} + repository: ${{env.ORG_REPO}} + ref: ${{env.ORG_REPO_REF}} + path: ${{env.ORG_REPO_PATH}} # Python - name: configure python, if required @@ -139,7 +139,7 @@ jobs: with: command: config globs: | - ${ORG_REPO_PATH}/configs/default.markdownlint.jsonc + ${{env.ORG_REPO_PATH}}/configs/default.markdownlint.jsonc **/*.md # Make From bffdd8fdce6e64e23e113e7933b500db6c9a99ff Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 14:53:27 -0500 Subject: [PATCH 09/17] fix path --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a629a70..36a2c22 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,7 +54,7 @@ env: ORG_REPO: trailofbits.com/.github ORG_REPO_REF: ${{ github.job_workflow_sha }} - ORG_REPO_PATH: /tmp/org_github + ORG_REPO_PATH: tmp/org_github jobs: lint: From 46e986e604d0c1bc90851700593e9a62957864eb Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 14:59:06 -0500 Subject: [PATCH 10/17] hardcode ref --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 36a2c22..63aa243 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ env: INSTALL_EXTRA: lint ORG_REPO: trailofbits.com/.github - ORG_REPO_REF: ${{ github.job_workflow_sha }} + ORG_REPO_REF: ww/markdownlint ORG_REPO_PATH: tmp/org_github jobs: From 1125170e6eb740efff7f9437889c30e7bff7f20d Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 15:00:33 -0500 Subject: [PATCH 11/17] fix repo --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 63aa243..71a9892 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -52,7 +52,7 @@ env: # the subset of development dependencies installed. INSTALL_EXTRA: lint - ORG_REPO: trailofbits.com/.github + ORG_REPO: trailofbits/.github ORG_REPO_REF: ww/markdownlint ORG_REPO_PATH: tmp/org_github From 6af8143f9e26208ddac46eb524977820f4e86f7a Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 15:01:44 -0500 Subject: [PATCH 12/17] try workflow_sha again --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 71a9892..316d95a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ env: INSTALL_EXTRA: lint ORG_REPO: trailofbits/.github - ORG_REPO_REF: ww/markdownlint + ORG_REPO_REF: ${{ github.job_workflow_sha }} ORG_REPO_PATH: tmp/org_github jobs: From 8e30b93092bc0ba1fca2263fb39d2eb3c8ecb51c Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 15:09:20 -0500 Subject: [PATCH 13/17] default to main --- .github/workflows/lint.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 316d95a..9dc28f2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,6 +40,11 @@ on: default: false required: false type: boolean + org-repo-ref: + description: "the ref: branch or commit to use of the org repo" + default: "main" + required: false + type: string env: # Rust: GitHub Actions supports color codes, so always enable them. @@ -53,7 +58,7 @@ env: INSTALL_EXTRA: lint ORG_REPO: trailofbits/.github - ORG_REPO_REF: ${{ github.job_workflow_sha }} + ORG_REPO_REF: ${{ inputs.org-repo-ref }} ORG_REPO_PATH: tmp/org_github jobs: From 8a61e2a200b55af113f2f916a8e1f0505c54f67e Mon Sep 17 00:00:00 2001 From: James Olds Date: Tue, 31 Jan 2023 15:24:34 -0500 Subject: [PATCH 14/17] mv org repo --- .github/workflows/lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9dc28f2..3319131 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -59,7 +59,7 @@ env: ORG_REPO: trailofbits/.github ORG_REPO_REF: ${{ inputs.org-repo-ref }} - ORG_REPO_PATH: tmp/org_github + ORG_REPO_PATH: /tmp/org_github jobs: lint: @@ -70,7 +70,8 @@ jobs: with: repository: ${{env.ORG_REPO}} ref: ${{env.ORG_REPO_REF}} - path: ${{env.ORG_REPO_PATH}} + path: tmp/org_repo + - run: mv tmp/org_repo ${ORG_REPO_PATH} # Python - name: configure python, if required From cfecdac3ae4139a126fbba5e2f3a4260bc48532e Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 31 Jan 2023 16:13:21 -0500 Subject: [PATCH 15/17] markdownlint: remove MD043 settings Signed-off-by: William Woodruff --- configs/default.markdownlint.jsonc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/configs/default.markdownlint.jsonc b/configs/default.markdownlint.jsonc index 23563a2..dbe8814 100644 --- a/configs/default.markdownlint.jsonc +++ b/configs/default.markdownlint.jsonc @@ -184,15 +184,6 @@ }, // MD042/no-empty-links - No empty links "MD042": true, - // MD043/required-headings/required-headers - Required heading structure - "MD043": { - // List of headings - "headings": [], - // List of headings - "headers": [], - // Match case of headings - "match_case": false - }, // MD044/proper-names - Proper names should have the correct capitalization "MD044": { // List of proper names From aa779f02983fdb8ed40abc1e53ee0f62c63f6705 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 31 Jan 2023 16:28:29 -0500 Subject: [PATCH 16/17] lint: avoid a mv Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3319131..12f211d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -68,10 +68,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: - repository: ${{env.ORG_REPO}} - ref: ${{env.ORG_REPO_REF}} - path: tmp/org_repo - - run: mv tmp/org_repo ${ORG_REPO_PATH} + repository: ${{ env.ORG_REPO }} + ref: ${{ env.ORG_REPO_REF }} + path: ${{ env.ORG_REPO_PATH }} # Python - name: configure python, if required From 2a9c1e6fc69c659dd51481bcefc85581f5d2b9fd Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 31 Jan 2023 16:34:50 -0500 Subject: [PATCH 17/17] lint: avoid a full checkout Just grab the file from GH's CDN. Signed-off-by: William Woodruff --- .github/workflows/lint.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 12f211d..37cf5cb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -59,18 +59,12 @@ env: ORG_REPO: trailofbits/.github ORG_REPO_REF: ${{ inputs.org-repo-ref }} - ORG_REPO_PATH: /tmp/org_github jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/checkout@v3 - with: - repository: ${{ env.ORG_REPO }} - ref: ${{ env.ORG_REPO_REF }} - path: ${{ env.ORG_REPO_PATH }} # Python - name: configure python, if required @@ -138,13 +132,20 @@ jobs: working-directory: "${{ inputs.directory }}" # Markdown + - name: download markdownlint config + if: inputs.language == 'markdown' + run: | + curl \ + https://raw.githubusercontent.com/${{ env.ORG_REPO }}/${{ env.ORG_REPO_REF }}/configs/default.markdownlint.jsonc \ + > /tmp/default.markdownlint.jsonc + - name: run markdownlint-cli2 if: inputs.language == 'markdown' uses: DavidAnson/markdownlint-cli2-action@v9 with: command: config globs: | - ${{env.ORG_REPO_PATH}}/configs/default.markdownlint.jsonc + /tmp/default.markdownlint.jsonc **/*.md # Make