@@ -1,4 +1,4 @@
|
||||
* `{owner}/{repo}/.github/workflows/{filename}@{ref}`{% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4 %} for reusable workflows in {% ifversion fpt %}public and private{% elsif ghec or ghes > 3.7 or ghae > 3.7 %}public, internal and private{% else %}public and internal{% endif %} repositories.
|
||||
* `./.github/workflows/{filename}` for reusable workflows in the same repository.{% endif %}
|
||||
|
||||
`{ref}` can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security. For more information, see "[AUTOTITLE](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)." {% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4 %}If you use the second syntax option (without `{owner}/{repo}` and `@{ref}`) the called workflow is from the same commit as the caller workflow.{% endif %}
|
||||
`{ref}` can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security. For more information, see "[AUTOTITLE](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)."{% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4 %} If you use the second syntax option (without `{owner}/{repo}` and `@{ref}`) the called workflow is from the same commit as the caller workflow.{% endif %} Ref prefixes such as `refs/heads` and `refs/tags` are not allowed.
|
||||
|
||||
13
src/content-linter/lib/default-markdownlint-options.js
Normal file
13
src/content-linter/lib/default-markdownlint-options.js
Normal file
@@ -0,0 +1,13 @@
|
||||
export function testOptions(rule, module, fixtureFile) {
|
||||
const config = {
|
||||
default: false,
|
||||
[rule]: true,
|
||||
}
|
||||
|
||||
const options = {
|
||||
files: [fixtureFile],
|
||||
customRules: [module],
|
||||
config,
|
||||
}
|
||||
return options
|
||||
}
|
||||
19
src/content-linter/tests/unit/image-alt-text-length.js
Normal file
19
src/content-linter/tests/unit/image-alt-text-length.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { jest } from '@jest/globals'
|
||||
import markdownlint from 'markdownlint'
|
||||
|
||||
import { incorrectAltTextLength } from '../../lib/linting-rules/image-alt-text-length.js'
|
||||
import { testOptions } from '../../lib/default-markdownlint-options.js'
|
||||
const fixtureFile = 'src/content-linter/tests/unit/image-alt-text-length.md'
|
||||
|
||||
describe('image alt text length rule', () => {
|
||||
jest.setTimeout(60 * 1000)
|
||||
const options = testOptions('MD111', incorrectAltTextLength, fixtureFile)
|
||||
|
||||
const result = markdownlint.sync(options)
|
||||
test('image with correct length alt text', () => {
|
||||
const errors = result[fixtureFile]
|
||||
expect(Object.keys(result).length).toBe(1)
|
||||
expect(errors.length).toBe(2)
|
||||
expect(errors.map((error) => error.lineNumber)).toEqual([1, 7])
|
||||
})
|
||||
})
|
||||
7
src/content-linter/tests/unit/image-alt-text-length.md
Normal file
7
src/content-linter/tests/unit/image-alt-text-length.md
Normal file
@@ -0,0 +1,7 @@
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
Reference in New Issue
Block a user