1
0
mirror of synced 2026-01-04 18:06:26 -05:00

Merge pull request #25853 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2023-06-06 20:43:21 -04:00
committed by GitHub
4 changed files with 40 additions and 1 deletions

View File

@@ -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.

View 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
}

View 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])
})
})

View File

@@ -0,0 +1,7 @@
![012345678901234567890123456789012345678](./image.png)
![0123456789012345678901234567890123456789](./image.png)
![012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789](./image.png)
![0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891](./image.png)