Skip to content

Commit d078362

Browse files
authored
allow ./.github/actions first party action syntax exception to linter rule (#55963)
1 parent 7482dbb commit d078362

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/content-linter/lib/linting-rules/third-party-action-pinning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const actionRegex = /[\w-]+\/[\w-]+@[\w-]+/
99
// Detects a full-length commit SHA (40 hexadecimal characters)
1010
const shaRegex = /[\w-]+\/[\w-]+@[0-9a-fA-F]{40}/
1111
// Detects first-party actions
12-
const firstPartyPrefixes = ['actions/', 'github/', 'octo-org/', 'OWNER/']
12+
const firstPartyPrefixes = ['actions/', './.github/actions/', 'github/', 'octo-org/', 'OWNER/']
1313

1414
export const thirdPartyActionPinning = {
1515
names: ['GHD041', 'third-party-action-pinning'],

src/content-linter/tests/unit/third-party-action-pinning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe(thirdPartyActionPinning.names.join(' - '), () => {
1111
' build:',
1212
' runs-on: ubuntu-latest',
1313
' steps:',
14-
' - uses: actions/javascript-action@main',
14+
' - uses: ./.github/actions/javascript-action@main',
1515
'```',
1616
].join('\n')
1717
const result = await runRule(thirdPartyActionPinning, { strings: { markdown } })

0 commit comments

Comments
 (0)