From d07836265a7169f81ceeb62b4d8aac49730899d5 Mon Sep 17 00:00:00 2001 From: Robert Sese <734194+rsese@users.noreply.github.com> Date: Thu, 5 Jun 2025 20:35:27 -0500 Subject: [PATCH] allow `./.github/actions` first party action syntax exception to linter rule (#55963) --- .../lib/linting-rules/third-party-action-pinning.js | 2 +- src/content-linter/tests/unit/third-party-action-pinning.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content-linter/lib/linting-rules/third-party-action-pinning.js b/src/content-linter/lib/linting-rules/third-party-action-pinning.js index 0e9a96f7bdeb..b99c12eb24bc 100644 --- a/src/content-linter/lib/linting-rules/third-party-action-pinning.js +++ b/src/content-linter/lib/linting-rules/third-party-action-pinning.js @@ -9,7 +9,7 @@ const actionRegex = /[\w-]+\/[\w-]+@[\w-]+/ // Detects a full-length commit SHA (40 hexadecimal characters) const shaRegex = /[\w-]+\/[\w-]+@[0-9a-fA-F]{40}/ // Detects first-party actions -const firstPartyPrefixes = ['actions/', 'github/', 'octo-org/', 'OWNER/'] +const firstPartyPrefixes = ['actions/', './.github/actions/', 'github/', 'octo-org/', 'OWNER/'] export const thirdPartyActionPinning = { names: ['GHD041', 'third-party-action-pinning'], diff --git a/src/content-linter/tests/unit/third-party-action-pinning.js b/src/content-linter/tests/unit/third-party-action-pinning.js index 8ac68db078f8..49da357395c6 100644 --- a/src/content-linter/tests/unit/third-party-action-pinning.js +++ b/src/content-linter/tests/unit/third-party-action-pinning.js @@ -11,7 +11,7 @@ describe(thirdPartyActionPinning.names.join(' - '), () => { ' build:', ' runs-on: ubuntu-latest', ' steps:', - ' - uses: actions/javascript-action@main', + ' - uses: ./.github/actions/javascript-action@main', '```', ].join('\n') const result = await runRule(thirdPartyActionPinning, { strings: { markdown } })