1
.github/allowed-actions.js
vendored
1
.github/allowed-actions.js
vendored
@@ -18,6 +18,7 @@ export default [
|
||||
'dawidd6/action-download-artifact@af92a8455a59214b7b932932f2662fdefbd78126', // v2.15.0
|
||||
'docker://chinthakagodawita/autoupdate-action:v1',
|
||||
'dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58',
|
||||
'trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b', // v1.2.4
|
||||
'github/codeql-action/analyze@v1',
|
||||
'github/codeql-action/init@v1',
|
||||
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
|
||||
|
||||
@@ -59,11 +59,11 @@ jobs:
|
||||
#
|
||||
# https://docs.github.com/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions
|
||||
|
||||
- if: ${{ failure() }}
|
||||
- if: ${{ failure() && env.FREEZE != 'true' }}
|
||||
name: Get title for issue
|
||||
id: check
|
||||
run: echo "::set-output name=title::$(head -1 broken_github_github_links.md)"
|
||||
- if: ${{ failure() }}
|
||||
- if: ${{ failure() && env.FREEZE != 'true'}}
|
||||
name: Create issue from file
|
||||
id: github-github-broken-link-report
|
||||
uses: peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e
|
||||
|
||||
4
.github/workflows/enterprise-dates.yml
vendored
4
.github/workflows/enterprise-dates.yml
vendored
@@ -68,7 +68,7 @@ jobs:
|
||||
branch: enterprise-server-dates-update
|
||||
delete-branch: true
|
||||
|
||||
- if: ${{ failure() }}
|
||||
- if: ${{ failure() && env.FREEZE != 'true' }}
|
||||
name: Delete remote branch (if previous steps failed)
|
||||
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
||||
with:
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
|
||||
if: failure()
|
||||
if: ${{ failure() && env.FREEZE != 'true' }}
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
|
||||
2
.github/workflows/remove-unused-assets.yml
vendored
2
.github/workflows/remove-unused-assets.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
project: Core docs work for the current week
|
||||
project-column: Should do
|
||||
branch: remove-unused-assets
|
||||
- if: ${{ failure() }}
|
||||
- if: ${{ failure() && env.FREEZE != 'true' }}
|
||||
name: Delete remote branch (if previous steps failed)
|
||||
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
||||
with:
|
||||
|
||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -46,6 +46,18 @@ jobs:
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
|
||||
- name: Gather files changed
|
||||
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b
|
||||
id: get_diff_files
|
||||
with:
|
||||
# So that `steps.get_diff_files.outputs.files` becomes
|
||||
# a string like `foo.js path/bar.md`
|
||||
output: ' '
|
||||
|
||||
- name: Insight into changed files
|
||||
run: |
|
||||
echo ${{ steps.get_diff_files.outputs.files }}
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
with:
|
||||
@@ -67,4 +79,6 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
DIFF_FILES: ${{ steps.get_diff_files.outputs.files }}
|
||||
run: npm run test tests/${{ matrix.test-group }}/
|
||||
|
||||
2
.github/workflows/update-graphql-files.yml
vendored
2
.github/workflows/update-graphql-files.yml
vendored
@@ -75,7 +75,7 @@ jobs:
|
||||
number: ${{ steps.create-pull-request.outputs.pull-request-number }}
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
|
||||
if: failure()
|
||||
if: ${{ failure() && env.FREEZE != 'true' }}
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
|
||||
@@ -356,6 +356,63 @@ function getContent(content) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Filter out entries from an array like this:
|
||||
//
|
||||
// [
|
||||
// [relativePath, absolutePath],
|
||||
// ...
|
||||
// so it's only the files mentioned in the DIFF_FILES environment
|
||||
// variable, but only if it's set and present.
|
||||
|
||||
// Setting an environment varible called `DIFF_FILES` is optional.
|
||||
// But if and only if it's set, we will respect it.
|
||||
// And if it set, turn it into a cleaned up Set so it's made available
|
||||
// every time we use it.
|
||||
if (process.env.DIFF_FILES) {
|
||||
// Parse and turn that environment variable string into a set.
|
||||
// It's faster to do this once and then re-use over and over in the
|
||||
// .filter() later on.
|
||||
const only = new Set(
|
||||
// If the environment variable encodes all the names
|
||||
// with quotation marks, strip them.
|
||||
// E.g. Turn `"foo" "bar"` into ['foo', 'bar']
|
||||
// Note, this assumes no possible file contains a space.
|
||||
process.env.DIFF_FILES.split(/\s+/g).map((name) => {
|
||||
if (/^['"]/.test(name) && /['"]$/.test(name)) {
|
||||
return name.slice(1, -1)
|
||||
}
|
||||
return name
|
||||
})
|
||||
)
|
||||
const filterFiles = (tuples) =>
|
||||
tuples.filter(
|
||||
([relativePath, absolutePath]) => only.has(relativePath) || only.has(absolutePath)
|
||||
)
|
||||
mdToLint = filterFiles(mdToLint)
|
||||
ymlToLint = filterFiles(ymlToLint)
|
||||
ghesReleaseNotesToLint = filterFiles(ghesReleaseNotesToLint)
|
||||
ghaeReleaseNotesToLint = filterFiles(ghaeReleaseNotesToLint)
|
||||
learningTracksToLint = filterFiles(learningTracksToLint)
|
||||
featureVersionsToLint = filterFiles(featureVersionsToLint)
|
||||
}
|
||||
|
||||
if (
|
||||
mdToLint.length +
|
||||
ymlToLint.length +
|
||||
ghesReleaseNotesToLint.length +
|
||||
ghaeReleaseNotesToLint.length +
|
||||
learningTracksToLint.length +
|
||||
featureVersionsToLint.length <
|
||||
1
|
||||
) {
|
||||
// With this in place, at least one `test()` is called and you don't
|
||||
// get the `Your test suite must contain at least one test.` error
|
||||
// from `jest`.
|
||||
describe('deliberately do nothing', () => {
|
||||
test('void', () => {})
|
||||
})
|
||||
}
|
||||
|
||||
describe('lint markdown content', () => {
|
||||
if (mdToLint.length < 1) return
|
||||
describe.each(mdToLint)('%s', (markdownRelPath, markdownAbsPath) => {
|
||||
|
||||
Reference in New Issue
Block a user