Merge branch 'main' into patch-1
1
.eslintignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
dist/
|
||||||
28
.eslintrc.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
commonjs: true,
|
||||||
|
es2020: true,
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
parser: 'babel-eslint',
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'standard'
|
||||||
|
],
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 11
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: [
|
||||||
|
'**/tests/**/*.js'
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
jest: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -22,6 +22,6 @@ Thanks again!
|
|||||||
|
|
||||||
### Check off the following:
|
### Check off the following:
|
||||||
- [ ] All of the tests are passing.
|
- [ ] All of the tests are passing.
|
||||||
- [ ] I have reviewed my changes in staging.
|
- [ ] I have reviewed my changes in staging. (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**)
|
||||||
- [ ] For content changes, I have reviewed the [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md)
|
- [ ] For content changes, I have reviewed the [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md)
|
||||||
- [ ] For content changes, I have reviewed the [Content style guide for GitHub Docs](https://github.com/github/docs/blob/main/contributing/content-style-guide.md).
|
- [ ] For content changes, I have reviewed the [Content style guide for GitHub Docs](https://github.com/github/docs/blob/main/contributing/content-style-guide.md).
|
||||||
|
|||||||
36
.github/actions-scripts/enterprise-algolia-label.js
vendored
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
const core = require('@actions/core')
|
||||||
|
const eventPayload = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'))
|
||||||
|
|
||||||
|
// This workflow-run script does the following:
|
||||||
|
// 1. Gets an array of labels on a PR.
|
||||||
|
// 2. Finds one with the relevant Algolia text; if none found, exits early.
|
||||||
|
// 3. Gets the version substring from the label string.
|
||||||
|
|
||||||
|
const labelText = 'sync-english-index-for-'
|
||||||
|
const labelsArray = eventPayload.pull_request.labels
|
||||||
|
|
||||||
|
// Exit early if no labels are on this PR
|
||||||
|
if (!(labelsArray && labelsArray.length)) {
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the relevant label
|
||||||
|
const algoliaLabel = labelsArray
|
||||||
|
.map(label => label.name)
|
||||||
|
.find(label => label.startsWith(labelText))
|
||||||
|
|
||||||
|
// Exit early if no relevant label is found
|
||||||
|
if (!algoliaLabel) {
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Given: sync-english-index-for-enterprise-server@3.0
|
||||||
|
// Returns: enterprise-server@3.0
|
||||||
|
const versionToSync = algoliaLabel.split(labelText)[1]
|
||||||
|
|
||||||
|
// Store the version so we can access it later in the workflow
|
||||||
|
core.setOutput('versionToSync', versionToSync)
|
||||||
|
process.exit(0)
|
||||||
41
.github/actions-scripts/openapi-schema-branch.js
vendored
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const { execSync } = require('child_process')
|
||||||
|
const semver = require('semver')
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This script performs two checks to prevent shipping development mode OpenAPI schemas:
|
||||||
|
* - Ensures the `info.version` property is a semantic version.
|
||||||
|
* In development mode, the `info.version` property is a string
|
||||||
|
* containing the `github/github` branch name.
|
||||||
|
* - Ensures the decorated schema matches the dereferenced schema.
|
||||||
|
* The workflow that calls this script runs `script/rest/update-files.js`
|
||||||
|
* with the `--decorate-only` switch then checks to see if files changed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Check that the `info.version` property is a semantic version
|
||||||
|
const dereferencedDir = path.join(process.cwd(), 'lib/rest/static/dereferenced')
|
||||||
|
const schemas = fs.readdirSync(dereferencedDir)
|
||||||
|
schemas.forEach(filename => {
|
||||||
|
const schema = require(path.join(dereferencedDir, filename))
|
||||||
|
if (!semver.valid(schema.info.version)) {
|
||||||
|
console.log(`🚧⚠️ Your branch contains a development mode OpenAPI schema: ${schema.info.version}. This check is a reminder to not 🚢 OpenAPI files in development mode. 🛑`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Check that the decorated schema matches the dereferenced schema
|
||||||
|
const changedFiles = execSync('git diff --name-only HEAD').toString()
|
||||||
|
|
||||||
|
if(changedFiles !== '') {
|
||||||
|
console.log(`These files were changed:\n${changedFiles}`)
|
||||||
|
console.log(`🚧⚠️ Your decorated and dereferenced schema files don't match. Ensure you're using decorated and dereferenced schemas from the automatically created pull requests by the 'github-openapi-bot' user. For more information, see 'script/rest/README.md'. 🛑`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// All checks pass, ready to ship
|
||||||
|
console.log('All good 👍')
|
||||||
|
process.exit(0)
|
||||||
7
.github/allowed-actions.js
vendored
@@ -21,13 +21,16 @@ module.exports = [
|
|||||||
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
|
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
|
||||||
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
|
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
|
||||||
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
|
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
|
||||||
|
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
|
||||||
'pascalgn/automerge-action@c9bd182',
|
'pascalgn/automerge-action@c9bd182',
|
||||||
'peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5',
|
'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
|
||||||
|
'peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd',
|
||||||
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
|
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
|
||||||
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
|
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
|
||||||
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
|
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
|
||||||
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
|
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
|
||||||
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
|
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
|
||||||
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
|
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
|
||||||
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
|
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
|
||||||
|
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575'
|
||||||
]
|
]
|
||||||
|
|||||||
25
.github/workflows/60-days-stale-check.yml
vendored
@@ -1,20 +1,21 @@
|
|||||||
name: 60 Days Stale Check
|
name: 60 Days Stale Check
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "40 16 * * *" # Run each day at 16:40 UTC / 8:40 PST
|
- cron: '40 16 * * *' # Run each day at 16:40 UTC / 8:40 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
|
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
|
||||||
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
|
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
|
||||||
days-before-stale: 60
|
days-before-stale: 60
|
||||||
days-before-close: -1
|
days-before-close: -1
|
||||||
only-labels: 'engineering'
|
only-labels: 'engineering'
|
||||||
stale-issue-label: 'stale'
|
stale-issue-label: 'stale'
|
||||||
stale-pr-label: 'stale'
|
stale-pr-label: 'stale'
|
||||||
|
exempt-pr-labels: 'never-stale'
|
||||||
|
exempt-issue-labels: 'never-stale'
|
||||||
|
|||||||
8
.github/workflows/auto-label-prs.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
name: Auto label Pull Requests
|
name: Auto label Pull Requests
|
||||||
on:
|
on:
|
||||||
- pull_request
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
|
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
|||||||
8
.github/workflows/automerge-dependencies.yml
vendored
@@ -3,10 +3,10 @@ name: Auto Merge Dependency Updates
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "package*.json"
|
- 'package*.json'
|
||||||
- "Gemfile*"
|
- 'Gemfile*'
|
||||||
- "Dockerfile"
|
- 'Dockerfile'
|
||||||
- ".github/workflows/**"
|
- '.github/workflows/**'
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
types:
|
types:
|
||||||
- edited
|
- edited
|
||||||
|
|||||||
20
.github/workflows/automerge.yml
vendored
@@ -23,14 +23,14 @@ jobs:
|
|||||||
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')
|
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')
|
||||||
steps:
|
steps:
|
||||||
- name: automerge
|
- name: automerge
|
||||||
uses: "pascalgn/automerge-action@c9bd182"
|
uses: 'pascalgn/automerge-action@c9bd182'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: "${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}"
|
GITHUB_TOKEN: '${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}'
|
||||||
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash"
|
MERGE_METHOD_LABELS: 'automerge=merge,autosquash=squash'
|
||||||
MERGE_COMMIT_MESSAGE: "pull-request-title"
|
MERGE_COMMIT_MESSAGE: 'pull-request-title'
|
||||||
MERGE_METHOD: "merge"
|
MERGE_METHOD: 'merge'
|
||||||
MERGE_FORKS: "true"
|
MERGE_FORKS: 'true'
|
||||||
MERGE_RETRIES: "50"
|
MERGE_RETRIES: '50'
|
||||||
MERGE_RETRY_SLEEP: "10000" # ten seconds
|
MERGE_RETRY_SLEEP: '10000' # ten seconds
|
||||||
UPDATE_LABELS: "automerge,autosquash"
|
UPDATE_LABELS: 'automerge,autosquash'
|
||||||
UPDATE_METHOD: "merge"
|
UPDATE_METHOD: 'merge'
|
||||||
|
|||||||
12
.github/workflows/browser-test.yml
vendored
@@ -20,18 +20,22 @@ jobs:
|
|||||||
paths: '[".github/workflows/browser-test.yml","assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]'
|
paths: '[".github/workflows/browser-test.yml","assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]'
|
||||||
build:
|
build:
|
||||||
needs: see_if_should_skip
|
needs: see_if_should_skip
|
||||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||||
|
# Even if if doesn't do anything
|
||||||
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Checkout
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Install
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Install
|
||||||
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
||||||
with:
|
with:
|
||||||
args: npm ci
|
args: npm ci
|
||||||
|
|
||||||
- name: Test
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Test
|
||||||
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
||||||
with:
|
with:
|
||||||
args: npm run browser-test
|
args: npm run browser-test
|
||||||
|
|||||||
62
.github/workflows/check-all-english-links.yml
vendored
@@ -1,8 +1,9 @@
|
|||||||
name: Check all English links
|
name: Check all English links
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "40 19 * * *" # once a day at 19:40 UTC / 11:40 PST
|
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_all_english_links:
|
check_all_english_links:
|
||||||
@@ -10,27 +11,38 @@ jobs:
|
|||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- name: npm ci
|
- name: npm ci
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: npm run build
|
- name: npm run build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
- name: Run script
|
- name: Run script
|
||||||
run: script/check-external-links en > broken_links.md
|
run: |
|
||||||
- name: Check if any broken links
|
script/check-english-links.js > broken_links.md
|
||||||
id: check
|
- if: ${{ failure() }}
|
||||||
run: |
|
name: Get title for issue
|
||||||
if [ "$(grep 'All links are good' broken_links.md)" ]; then
|
id: check
|
||||||
echo ::set-output name=continue::no
|
run: echo "::set-output name=title::$(head -1 broken_links.md)"
|
||||||
else
|
- if: ${{ failure() }}
|
||||||
echo "::set-output name=continue::yes"
|
name: Close previous report
|
||||||
echo "::set-output name=title::$(grep 'found on help.github.com' broken_links.md)"
|
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
|
||||||
fi
|
with:
|
||||||
- if: ${{ steps.check.outputs.continue == 'yes' }}
|
query: 'label:"broken link report"'
|
||||||
name: Create issue from file
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5
|
- if: ${{ failure() }}
|
||||||
with:
|
name: Create issue from file
|
||||||
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
id: broken-link-report
|
||||||
title: ${{ steps.check.outputs.title }}
|
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
|
||||||
content-filepath: ./broken_links.md
|
with:
|
||||||
labels: broken link report
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
|
title: ${{ steps.check.outputs.title }}
|
||||||
|
content-filepath: ./broken_links.md
|
||||||
|
labels: broken link report
|
||||||
|
- if: ${{ failure() }}
|
||||||
|
name: Add comment to issue
|
||||||
|
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
|
||||||
|
with:
|
||||||
|
body: |
|
||||||
|
cc @github/docs-content
|
||||||
|
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
|
||||||
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
|
|||||||
18
.github/workflows/codeql.yml
vendored
@@ -1,19 +1,19 @@
|
|||||||
name: "CodeQL analysis"
|
name: CodeQL analysis
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '**/*.js'
|
- '**/*.js'
|
||||||
- '.github/workflows/codeql.yml'
|
- '.github/workflows/codeql.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- uses: github/codeql-action/init@v1
|
- uses: github/codeql-action/init@v1
|
||||||
with:
|
with:
|
||||||
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
|
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
|
||||||
- uses: github/codeql-action/analyze@v1
|
- uses: github/codeql-action/analyze@v1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
4
.github/workflows/crowdin.yml
vendored
@@ -3,7 +3,7 @@ name: Crowdin Sync
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "33 2 * * *" # every day at 2:33 UTC at least until automerge is working
|
- cron: '33 2 * * *' # every day at 2:33 UTC at least until automerge is working
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync_with_crowdin:
|
sync_with_crowdin:
|
||||||
@@ -47,5 +47,3 @@ jobs:
|
|||||||
# See https://crowdin.com/settings#api-key to generate a token
|
# See https://crowdin.com/settings#api-key to generate a token
|
||||||
# This token was created by logging into Crowdin with the octoglot user
|
# This token was created by logging into Crowdin with the octoglot user
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,23 +9,23 @@ jobs:
|
|||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
- name: cache node modules
|
- name: cache node modules
|
||||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
- name: npm ci
|
- name: npm ci
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: (Dry run) sync indices
|
- name: (Dry run) sync indices
|
||||||
env:
|
env:
|
||||||
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
||||||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: npm run sync-search-dry-run
|
run: npm run sync-search-dry-run
|
||||||
|
|||||||
137
.github/workflows/first-responder-docs-content.yml
vendored
@@ -1,7 +1,12 @@
|
|||||||
name: First responder docs-content
|
name: First responder docs-content
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [reopened, opened, ready_for_review, closed, unlabeled]
|
types:
|
||||||
|
- reopened
|
||||||
|
- opened
|
||||||
|
- ready_for_review
|
||||||
|
- closed
|
||||||
|
- unlabeled
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
first-responder-triage-pr:
|
first-responder-triage-pr:
|
||||||
@@ -10,46 +15,46 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check if the event originated from a team member
|
- name: Check if the event originated from a team member
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
id: set-result
|
id: set-result
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
const repoName = context.payload.repository.name
|
const repoName = context.payload.repository.name
|
||||||
const ownerName = context.payload.repository.owner.login
|
const ownerName = context.payload.repository.owner.login
|
||||||
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
|
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
|
||||||
const updatedIssueInformation = await github.issues.get({
|
const updatedIssueInformation = await github.issues.get({
|
||||||
owner: ownerName,
|
owner: ownerName,
|
||||||
repo: repoName,
|
repo: repoName,
|
||||||
issue_number: issueNumber
|
issue_number: issueNumber
|
||||||
})
|
})
|
||||||
const teamMembers = await github.request(
|
const teamMembers = await github.request(
|
||||||
`/orgs/github/teams/docs/members`
|
`/orgs/github/teams/docs/members`
|
||||||
)
|
)
|
||||||
const logins = teamMembers.data.map(member => member.login)
|
const logins = teamMembers.data.map(member => member.login)
|
||||||
// ignore PRs opened by docs bot accounts
|
// ignore PRs opened by docs bot accounts
|
||||||
logins.push('Octomerger', 'octoglot')
|
logins.push('Octomerger', 'octoglot')
|
||||||
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
|
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
|
||||||
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
|
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
|
||||||
return 'true'
|
return 'true'
|
||||||
}
|
}
|
||||||
console.log(`This issue or pull request was authored by an external contributor.`)
|
console.log(`This issue or pull request was authored by an external contributor.`)
|
||||||
return 'false'
|
return 'false'
|
||||||
- name: Label external contributor pull requests with docs-content-fr
|
- name: Label external contributor pull requests with docs-content-fr
|
||||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
if: steps.set-result.outputs.result == 'false'
|
if: steps.set-result.outputs.result == 'false'
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
|
repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
|
||||||
add-labels: "docs-content-fr"
|
add-labels: 'docs-content-fr'
|
||||||
- name: Triage to FR PR project column
|
- name: Triage to FR PR project column
|
||||||
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
||||||
if: steps.set-result.outputs.result == 'false'
|
if: steps.set-result.outputs.result == 'false'
|
||||||
with:
|
with:
|
||||||
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
project-url: "https://github.com/orgs/github/projects/1367"
|
project-url: 'https://github.com/orgs/github/projects/1367'
|
||||||
column-name: "Docs-internal external contributor PRs"
|
column-name: 'Docs-internal external contributor PRs'
|
||||||
|
|
||||||
first-responder-remove-pr:
|
first-responder-remove-pr:
|
||||||
name: Remove PR from FR project board
|
name: Remove PR from FR project board
|
||||||
@@ -57,29 +62,29 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Remove card from project
|
- name: Remove card from project
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
const issueToRemove = context.payload.number
|
const issueToRemove = context.payload.number
|
||||||
const cards = await github.projects.listCards({
|
const cards = await github.projects.listCards({
|
||||||
column_id: 11130889
|
column_id: 11130889
|
||||||
})
|
})
|
||||||
cards.data.forEach(card => {
|
cards.data.forEach(card => {
|
||||||
if (card.content_url) {
|
if (card.content_url) {
|
||||||
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10)
|
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10)
|
||||||
if (cardIssueNumber === issueToRemove) {
|
if (cardIssueNumber === issueToRemove) {
|
||||||
const cards = github.projects.deleteCard({
|
const cards = github.projects.deleteCard({
|
||||||
card_id: card.id
|
card_id: card.id
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
- name: Remove docs-content-fr label if not already removed
|
||||||
- name: Remove docs-content-fr label if not already removed
|
if: github.event.action == 'closed'
|
||||||
if: github.event.action == 'closed'
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
with:
|
||||||
with:
|
repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
|
||||||
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
|
remove-labels: 'docs-content-fr'
|
||||||
remove-labels: "docs-content-fr"
|
|
||||||
|
|||||||
4
.github/workflows/js-lint.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cancel_others: 'false'
|
cancel_others: 'false'
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml"]'
|
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml", ".eslint*"]'
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npx standard
|
run: npx eslint .
|
||||||
|
|
||||||
- name: Check dependencies
|
- name: Check dependencies
|
||||||
run: npm run check-deps
|
run: npm run check-deps
|
||||||
|
|||||||
3
.github/workflows/merged-notification.yml
vendored
@@ -1,7 +1,8 @@
|
|||||||
name: Merged notification
|
name: Merged notification
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: ['closed']
|
types:
|
||||||
|
- 'closed'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
comment:
|
comment:
|
||||||
|
|||||||
37
.github/workflows/openapi-decorate.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: OpenAPI generate decorated schema files
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-decorated-files:
|
||||||
|
if: github.event.pull_request.user.login == 'github-openapi-bot'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Label pull requests with 'github-openapi-bot'
|
||||||
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
|
with:
|
||||||
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
add-labels: 'github-openapi-bot'
|
||||||
|
- name: Checkout repository code
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Decorate the dereferenced OpenAPI schemas
|
||||||
|
run: script/rest/update-files.js --decorate-only
|
||||||
|
|
||||||
|
- name: Check in the decorated files
|
||||||
|
uses: EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575
|
||||||
|
with:
|
||||||
|
# The arguments for the `git add` command
|
||||||
|
add: 'lib/rest/static/decorated'
|
||||||
|
|
||||||
|
# The message for the commit
|
||||||
|
message: 'Add decorated OpenAPI schema files'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||||
22
.github/workflows/openapi-schema-check.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: OpenAPI dev mode check
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-schema-versions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository code
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
# Differences between decorated and dereferenced files indicates a problem
|
||||||
|
- name: Generate decorated files to check that there are no differences
|
||||||
|
run: script/rest/update-files.js --decorate-only
|
||||||
|
|
||||||
|
- name: Check if deref/decorated schemas are dev mode and that they match
|
||||||
|
run: .github/actions-scripts/openapi-schema-branch.js
|
||||||
4
.github/workflows/pa11y.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: "Pa11y"
|
name: Pa11y
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "25 17 * * *" # once a day at 17:25 UTC / 11:50 PST
|
- cron: '25 17 * * *' # once a day at 17:25 UTC / 11:50 PST
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
16
.github/workflows/ping-staging-apps.yml
vendored
@@ -2,7 +2,7 @@ name: Ping staging apps
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "*/20 * * * *" # every twenty minutes
|
- cron: '*/20 * * * *' # every twenty minutes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ping_staging_apps:
|
ping_staging_apps:
|
||||||
@@ -12,10 +12,10 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
|
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- name: npm ci
|
- name: npm ci
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: npm run build
|
- name: npm run build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
- name: Run script
|
- name: Run script
|
||||||
run: script/ping-staging-apps.js
|
run: script/ping-staging-apps.js
|
||||||
|
|||||||
81
.github/workflows/remove-unused-assets.yml
vendored
@@ -5,7 +5,7 @@ env:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "20 15 * * 0" # run every Sunday at 20:15 UTC / 12:15 PST
|
- cron: '20 15 * * 0' # run every Sunday at 20:15 UTC / 12:15 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
remove_unused_assets:
|
remove_unused_assets:
|
||||||
@@ -13,42 +13,43 @@ jobs:
|
|||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ env.FREEZE == 'true' }}
|
- if: ${{ env.FREEZE == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||||
exit 1 # prevents further steps from running
|
exit 1 # prevents further steps from running
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- name: npm ci
|
- name: npm ci
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run scripts
|
- name: Run scripts
|
||||||
run: |
|
run: |
|
||||||
script/remove-unused-assets.js > results.md
|
script/remove-unused-assets.js > results.md
|
||||||
script/remove-extraneous-translation-files.js
|
script/remove-extraneous-translation-files.js
|
||||||
- name: Get script results to use in PR body
|
- name: Get script results to use in PR body
|
||||||
id: results
|
id: results
|
||||||
uses: juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512
|
uses: juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512
|
||||||
with:
|
with:
|
||||||
path: ./results.md
|
path: ./results.md
|
||||||
- name: Remove script results file
|
- name: Remove script results file
|
||||||
run: rm -rf ./results.md
|
run: rm -rf ./results.md
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
||||||
with:
|
with:
|
||||||
# need to use a token with repo and workflow scopes for this step
|
# need to use a token with repo and workflow scopes for this step
|
||||||
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
commit-message: Action ran script/remove-unused-assets.js
|
commit-message: Action ran script/remove-unused-assets.js
|
||||||
title: Remove unused assets
|
title: Remove unused assets
|
||||||
body: "Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n
|
body:
|
||||||
${{ steps.results.outputs.content }}
|
"Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n
|
||||||
\n\nIf you have any questions, please contact @github/docs-engineering."
|
${{ steps.results.outputs.content }}
|
||||||
labels: unused assets
|
\n\nIf you have any questions, please contact @github/docs-engineering."
|
||||||
project: Core docs work for the current week
|
labels: unused assets
|
||||||
project-column: Should do
|
project: Core docs work for the current week
|
||||||
branch: remove-unused-assets
|
project-column: Should do
|
||||||
- if: ${{ failure() }}
|
branch: remove-unused-assets
|
||||||
name: Delete remote branch (if previous steps failed)
|
- if: ${{ failure() }}
|
||||||
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
name: Delete remote branch (if previous steps failed)
|
||||||
with:
|
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
with:
|
||||||
branches: remove-unused-assets
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branches: remove-unused-assets
|
||||||
|
|||||||
26
.github/workflows/repo-freeze-check.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Repo Freeze Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
- ready_for_review
|
||||||
|
- unlocked
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
FREEZE: ${{ secrets.FREEZE }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-freezer:
|
||||||
|
name: Prevent merging during deployment freezes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fail if repo merges are paused
|
||||||
|
if: ${{ env.FREEZE == 'true' }}
|
||||||
|
run: |
|
||||||
|
echo 'Merges into the "main" branch on this repo are currently paused!'
|
||||||
|
exit 1
|
||||||
21
.github/workflows/repo-freeze-reminders.yml
vendored
@@ -2,7 +2,7 @@ name: Repo Freeze Reminders
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "00 11 * * *" # once per day around 11:00am UTC
|
- cron: '00 11 * * *' # once per day around 11:00am UTC
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FREEZE: ${{ secrets.FREEZE }}
|
FREEZE: ${{ secrets.FREEZE }}
|
||||||
@@ -13,13 +13,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
steps:
|
steps:
|
||||||
|
- name: Send Slack notification if repo is frozen
|
||||||
- name: Send Slack notification if repo is frozen
|
if: ${{ env.FREEZE == 'true' }}
|
||||||
if: ${{ env.FREEZE == 'true' }}
|
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
env:
|
||||||
env:
|
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
SLACK_USERNAME: docs-repo-sync
|
||||||
SLACK_USERNAME: docs-repo-sync
|
SLACK_ICON_EMOJI: ':freezing_face:'
|
||||||
SLACK_ICON_EMOJI: ':freezing_face:'
|
SLACK_COLOR: '#51A0D5' # Carolina Blue
|
||||||
SLACK_COLOR: '#51A0D5' # Carolina Blue
|
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
|
||||||
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
|
|
||||||
|
|||||||
102
.github/workflows/repo-sync.yml
vendored
@@ -8,7 +8,7 @@ name: Repo Sync
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "*/15 * * * *" # every 15 minutes
|
- cron: '*/15 * * * *' # every 15 minutes
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FREEZE: ${{ secrets.FREEZE }}
|
FREEZE: ${{ secrets.FREEZE }}
|
||||||
@@ -18,65 +18,63 @@ jobs:
|
|||||||
name: Check for deployment freezes
|
name: Check for deployment freezes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Exit if repo is frozen
|
||||||
- name: Exit if repo is frozen
|
if: ${{ env.FREEZE == 'true' }}
|
||||||
if: ${{ env.FREEZE == 'true' }}
|
run: |
|
||||||
run: |
|
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
exit 1 # prevents further steps from running
|
||||||
exit 1 # prevents further steps from running
|
|
||||||
|
|
||||||
repo-sync:
|
repo-sync:
|
||||||
name: Repo Sync
|
name: Repo Sync
|
||||||
needs: check-freezer
|
needs: check-freezer
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check out repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Sync repo to branch
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
|
with:
|
||||||
|
source_repo: ${{ secrets.SOURCE_REPO }} # https://${access_token}@github.com/github/the-other-repo.git
|
||||||
|
source_branch: main
|
||||||
|
destination_branch: repo-sync
|
||||||
|
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
|
|
||||||
- name: Sync repo to branch
|
- name: Create pull request
|
||||||
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
|
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
with:
|
with:
|
||||||
source_repo: ${{ secrets.SOURCE_REPO }} # https://${access_token}@github.com/github/the-other-repo.git
|
source_branch: repo-sync
|
||||||
source_branch: main
|
destination_branch: main
|
||||||
destination_branch: repo-sync
|
pr_title: 'repo sync'
|
||||||
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
|
||||||
|
pr_label: automerge,autoupdate
|
||||||
|
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Find pull request
|
||||||
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
|
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
|
||||||
env:
|
id: find-pull-request
|
||||||
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
with:
|
||||||
with:
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
source_branch: repo-sync
|
branch: repo-sync
|
||||||
destination_branch: main
|
base: main
|
||||||
pr_title: "repo sync"
|
|
||||||
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
|
|
||||||
pr_label: automerge,autoupdate
|
|
||||||
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
|
||||||
|
|
||||||
- name: Find pull request
|
- name: Approve pull request
|
||||||
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
|
if: ${{ steps.find-pull-request.outputs.number }}
|
||||||
id: find-pull-request
|
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: repo-sync
|
number: ${{ steps.find-pull-request.outputs.number }}
|
||||||
base: main
|
|
||||||
|
|
||||||
- name: Approve pull request
|
- name: Send Slack notification if workflow fails
|
||||||
if: ${{ steps.find-pull-request.outputs.number }}
|
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||||
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
if: ${{ failure() }}
|
||||||
with:
|
env:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||||
number: ${{ steps.find-pull-request.outputs.number }}
|
SLACK_USERNAME: docs-repo-sync
|
||||||
|
SLACK_ICON_EMOJI: ':ohno:'
|
||||||
- name: Send Slack notification if workflow fails
|
SLACK_COLOR: '#B90E0A' # Crimson
|
||||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
SLACK_MESSAGE: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22
|
||||||
if: ${{ failure() }}
|
|
||||||
env:
|
|
||||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
|
||||||
SLACK_USERNAME: docs-repo-sync
|
|
||||||
SLACK_ICON_EMOJI: ':ohno:'
|
|
||||||
SLACK_COLOR: '#B90E0A' # Crimson
|
|
||||||
SLACK_MESSAGE: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22
|
|
||||||
|
|||||||
12
.github/workflows/send-eng-issues-to-backlog.yml
vendored
@@ -2,7 +2,9 @@ name: Send Issue to EPD backlog
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [labeled, reopened]
|
types:
|
||||||
|
- labeled
|
||||||
|
- reopened
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
@@ -10,10 +12,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: Add issues with engineering label to project board
|
- name: Add issues with engineering label to project board
|
||||||
if: contains(github.event.issue.labels.*.name, 'engineering') || contains(github.event.issue.labels.*.name, 'design') || contains(github.event.issue.labels.*.name, 'Design')
|
if: contains(github.event.issue.labels.*.name, 'engineering') || contains(github.event.issue.labels.*.name, 'design') || contains(github.event.issue.labels.*.name, 'Design')
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
script: |
|
script: |
|
||||||
var column_id = 9659080;
|
var column_id = 9659080;
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ name: Start new engineering PR workflow
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, reopened]
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
@@ -12,52 +14,52 @@ jobs:
|
|||||||
DRAFT_COLUMN_ID: 10095775
|
DRAFT_COLUMN_ID: 10095775
|
||||||
REGULAR_COLUMN_ID: 10095779
|
REGULAR_COLUMN_ID: 10095779
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||||
script: |
|
script: |
|
||||||
// Only assign the engineering folks
|
// Only assign the engineering folks
|
||||||
try {
|
try {
|
||||||
await github.teams.getMembershipForUserInOrg({
|
await github.teams.getMembershipForUserInOrg({
|
||||||
org: 'github',
|
org: 'github',
|
||||||
team_slug: 'docs-engineering',
|
team_slug: 'docs-engineering',
|
||||||
username: context.payload.sender.login,
|
username: context.payload.sender.login,
|
||||||
});
|
});
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set column ID
|
// Set column ID
|
||||||
const column_id = context.payload.pull_request.draft
|
const column_id = context.payload.pull_request.draft
|
||||||
? process.env.DRAFT_COLUMN_ID
|
? process.env.DRAFT_COLUMN_ID
|
||||||
: process.env.REGULAR_COLUMN_ID
|
: process.env.REGULAR_COLUMN_ID
|
||||||
|
|
||||||
// Try to create the card on the GitHub Project
|
// Try to create the card on the GitHub Project
|
||||||
try {
|
try {
|
||||||
await github.projects.createCard({
|
await github.projects.createCard({
|
||||||
column_id: column_id,
|
column_id: column_id,
|
||||||
content_type: 'PullRequest',
|
content_type: 'PullRequest',
|
||||||
content_id: context.payload.pull_request.id
|
content_id: context.payload.pull_request.id
|
||||||
});
|
});
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Try to set the author as the assignee
|
// Try to set the author as the assignee
|
||||||
const owner = context.payload.repository.owner.login
|
const owner = context.payload.repository.owner.login
|
||||||
const repo = context.payload.repository.name
|
const repo = context.payload.repository.name
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await github.issues.addAssignees({
|
await github.issues.addAssignees({
|
||||||
owner: owner,
|
owner: owner,
|
||||||
repo: repo,
|
repo: repo,
|
||||||
issue_number: context.payload.pull_request.number,
|
issue_number: context.payload.pull_request.number,
|
||||||
assignees: [
|
assignees: [
|
||||||
context.payload.sender.login
|
context.payload.sender.login
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
updateIndices:
|
updateIndices:
|
||||||
@@ -12,29 +12,29 @@ jobs:
|
|||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
- name: cache node modules
|
- name: cache node modules
|
||||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
- name: npm ci
|
- name: npm ci
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: sync indices
|
- name: sync indices
|
||||||
env:
|
env:
|
||||||
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
||||||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: npm run sync-search
|
run: npm run sync-search
|
||||||
- name: Send slack notification if workflow run fails
|
- name: Send slack notification if workflow run fails
|
||||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||||
if: failure()
|
if: failure()
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||||
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. See https://github.com/github/docs-internal/actions?query=workflow%3AAlgolia
|
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. See https://github.com/github/docs-internal/actions?query=workflow%3AAlgolia
|
||||||
|
|||||||
46
.github/workflows/sync-single-english-algolia-index.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Algolia Sync Single English Index
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
- ready_for_review
|
||||||
|
- unlocked
|
||||||
|
|
||||||
|
# This workflow requires a label in the format `sync-english-index-for-<PLAN@RELEASE>`
|
||||||
|
jobs:
|
||||||
|
updateIndices:
|
||||||
|
name: Update English index for single version based on a label's version
|
||||||
|
if: github.repository == 'github/docs-internal'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- name: cache node modules
|
||||||
|
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
- name: npm ci
|
||||||
|
run: npm ci
|
||||||
|
- name: Get version from Algolia label if present; only continue if the label is found.
|
||||||
|
id: getVersion
|
||||||
|
run: $GITHUB_WORKSPACE/.github/actions-scripts/enterprise-algolia-label.js
|
||||||
|
- if: ${{ steps.getVersion.outputs.versionToSync }}
|
||||||
|
name: Sync English index for single version
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.getVersion.outputs.versionToSync }}
|
||||||
|
LANGUAGE: 'en'
|
||||||
|
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
||||||
|
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: npm run sync-search
|
||||||
6
.github/workflows/test-translations.yml
vendored
@@ -4,7 +4,7 @@ name: Node.js Tests - Translations
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "10 20 * * *" # once a day at 20:10 UTC / 12:10 PST
|
- cron: '10 20 * * *' # once a day at 20:10 UTC / 12:10 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npx standard
|
run: npx eslint .
|
||||||
|
|
||||||
- name: Check dependencies
|
- name: Check dependencies
|
||||||
run: npm run check-deps
|
run: npm run check-deps
|
||||||
@@ -78,4 +78,4 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npx jest tests/${{ matrix.test-group }}/
|
run: npx jest tests/${{ matrix.test-group }}/
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
|
|||||||
7
.github/workflows/test-windows.yml
vendored
@@ -5,10 +5,7 @@ name: Node.js Tests - Windows
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "50 19 * * *" # once a day at 19:50 UTC / 11:50 PST
|
- cron: '50 19 * * *' # once a day at 19:50 UTC / 11:50 PST
|
||||||
|
|
||||||
env:
|
|
||||||
CI: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@@ -48,4 +45,4 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npx jest tests/${{ matrix.test-group }}/
|
run: npx jest tests/${{ matrix.test-group }}/
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
|
|||||||
31
.github/workflows/test.yml
vendored
@@ -31,28 +31,34 @@ jobs:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
needs: see_if_should_skip
|
needs: see_if_should_skip
|
||||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
test-group:
|
||||||
|
[content, meta, rendering, routing, unit, links-and-images, graphql]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repo
|
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||||
|
# Even if if doesn't do anything
|
||||||
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Check out repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Setup node
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Setup node
|
||||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
|
|
||||||
- name: Get npm cache directory
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Get npm cache directory
|
||||||
id: npm-cache
|
id: npm-cache
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
- name: Cache node modules
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Cache node modules
|
||||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
@@ -60,20 +66,23 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: Install dependencies
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run build script
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Run build script
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Run tests
|
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
name: Run tests
|
||||||
run: npx jest tests/${{ matrix.test-group }}/
|
run: npx jest tests/${{ matrix.test-group }}/
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
|
|
||||||
- name: Send Slack notification if workflow fails
|
- name: Send Slack notification if workflow fails
|
||||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||||
if: failure() && github.ref == 'early-access'
|
if: failure() && github.ref == 'early-access'
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||||
SLACK_MESSAGE: "Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access"
|
SLACK_MESSAGE: 'Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access'
|
||||||
|
|||||||
86
.github/workflows/translations.yml
vendored
@@ -2,7 +2,7 @@ name: Translations
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "20 19 * * *" # once a day at 19:20 UTC / 11:20 PST
|
- cron: '20 19 * * *' # once a day at 19:20 UTC / 11:20 PST
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FREEZE: ${{ secrets.FREEZE }}
|
FREEZE: ${{ secrets.FREEZE }}
|
||||||
@@ -12,45 +12,45 @@ jobs:
|
|||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ env.FREEZE == 'true' }}
|
- if: ${{ env.FREEZE == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||||
exit 1 # prevents further steps from running
|
exit 1 # prevents further steps from running
|
||||||
- name: Find original Pull Request
|
- name: Find original Pull Request
|
||||||
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
|
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
|
||||||
id: pr
|
id: pr
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: translations
|
branch: translations
|
||||||
- if: ${{ steps.pr.outputs.number }}
|
- if: ${{ steps.pr.outputs.number }}
|
||||||
name: Check if already labeled
|
name: Check if already labeled
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
id: has-label
|
id: has-label
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { data: labels } = await github.issues.listLabelsOnIssue({
|
const { data: labels } = await github.issues.listLabelsOnIssue({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: ${{ steps.pr.outputs.number }}
|
issue_number: ${{ steps.pr.outputs.number }}
|
||||||
})
|
})
|
||||||
if (labels.find(label => label.name === 'automerge')) {
|
if (labels.find(label => label.name === 'automerge')) {
|
||||||
return 'ok'
|
return 'ok'
|
||||||
}
|
}
|
||||||
- if: ${{ !steps.has-label.outputs.result }}
|
- if: ${{ !steps.has-label.outputs.result }}
|
||||||
name: Approve Pull Request
|
name: Approve Pull Request
|
||||||
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
number: ${{ steps.pr.outputs.number }}
|
number: ${{ steps.pr.outputs.number }}
|
||||||
- if: ${{ !steps.has-label.outputs.result }}
|
- if: ${{ !steps.has-label.outputs.result }}
|
||||||
name: Add automerge label
|
name: Add automerge label
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
github.issues.addLabels({
|
github.issues.addLabels({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: ${{ steps.pr.outputs.number }},
|
issue_number: ${{ steps.pr.outputs.number }},
|
||||||
labels: ['automerge']
|
labels: ['automerge']
|
||||||
})
|
})
|
||||||
|
|||||||
73
.github/workflows/triage-issue-comments.yml
vendored
@@ -1,7 +1,8 @@
|
|||||||
name: Triage new issue comments
|
name: Triage new issue comments
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created]
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage-issue-comments:
|
triage-issue-comments:
|
||||||
@@ -9,38 +10,38 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check if the event originated from a team member
|
- name: Check if the event originated from a team member
|
||||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
id: is-internal-contributor
|
id: is-internal-contributor
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
const repo = context.payload.repository.name
|
const repo = context.payload.repository.name
|
||||||
const org = context.payload.repository.owner.login
|
const org = context.payload.repository.owner.login
|
||||||
const actor = context.actor
|
const actor = context.actor
|
||||||
let collaboratorStatus = ''
|
let collaboratorStatus = ''
|
||||||
try {
|
try {
|
||||||
collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', {
|
collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', {
|
||||||
owner: org,
|
owner: org,
|
||||||
repo: repo,
|
repo: repo,
|
||||||
username: actor
|
username: actor
|
||||||
})
|
})
|
||||||
console.log(`This issue was commented on by a Hubber.`)
|
console.log(`This issue was commented on by a Hubber.`)
|
||||||
return 'true'
|
return 'true'
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`This issue was commented on by an external contributor.`)
|
console.log(`This issue was commented on by an external contributor.`)
|
||||||
return 'false'
|
return 'false'
|
||||||
}
|
}
|
||||||
- name: Label issues with new comments with 'triage'
|
- name: Label issues with new comments with 'triage'
|
||||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
if: (steps.is-internal-contributor.outputs.result == 'false')
|
if: (steps.is-internal-contributor.outputs.result == 'false')
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
add-labels: "triage"
|
add-labels: 'triage'
|
||||||
- name: Triage to project board
|
- name: Triage to project board
|
||||||
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
||||||
with:
|
with:
|
||||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
project-url: "https://github.com/github/docs/projects/1"
|
project-url: 'https://github.com/github/docs/projects/1'
|
||||||
column-name: "Triage"
|
column-name: 'Triage'
|
||||||
|
|||||||
26
.github/workflows/triage-issues.yml
vendored
@@ -1,7 +1,9 @@
|
|||||||
name: Triage new issues
|
name: Triage new issues
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [reopened, opened]
|
types:
|
||||||
|
- reopened
|
||||||
|
- opened
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage_issues:
|
triage_issues:
|
||||||
@@ -9,14 +11,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Label new issues with 'triage'
|
- name: Label new issues with 'triage'
|
||||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
add-labels: "triage"
|
add-labels: 'triage'
|
||||||
- name: Triage to project board
|
- name: Triage to project board
|
||||||
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
||||||
with:
|
with:
|
||||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
project-url: "https://github.com/github/docs/projects/1"
|
project-url: 'https://github.com/github/docs/projects/1'
|
||||||
column-name: "Triage"
|
column-name: 'Triage'
|
||||||
|
|||||||
26
.github/workflows/triage-pull-requests.yml
vendored
@@ -1,7 +1,9 @@
|
|||||||
name: Triage new pull requests
|
name: Triage new pull requests
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [reopened, opened]
|
types:
|
||||||
|
- reopened
|
||||||
|
- opened
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage_pulls:
|
triage_pulls:
|
||||||
@@ -9,14 +11,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Label new pull requests with 'triage'
|
- name: Label new pull requests with 'triage'
|
||||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
add-labels: "triage"
|
add-labels: 'triage'
|
||||||
- name: Triage to project board
|
- name: Triage to project board
|
||||||
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
|
||||||
with:
|
with:
|
||||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
project-url: "https://github.com/github/docs/projects/1"
|
project-url: 'https://github.com/github/docs/projects/1'
|
||||||
column-name: "Triage"
|
column-name: 'Triage'
|
||||||
|
|||||||
18
.github/workflows/triage-stale-check.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Public Repo Stale Check
|
name: Public Repo Stale Check
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "45 16 * * *" # Run each day at 16:45 UTC / 8:45 PST
|
- cron: '45 16 * * *' # Run each day at 16:45 UTC / 8:45 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
@@ -9,10 +9,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
|
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
|
||||||
days-before-stale: 7
|
days-before-stale: 7
|
||||||
days-before-close: 10
|
days-before-close: 10
|
||||||
stale-pr-label: 'stale'
|
stale-pr-label: 'stale'
|
||||||
|
exempt-pr-labels: 'never-stale'
|
||||||
|
exempt-issue-labels: 'never-stale'
|
||||||
|
|||||||
104
.github/workflows/update-graphql-files.yml
vendored
@@ -10,63 +10,59 @@ env:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "20 16 * * *" # run every day at 16:20 UTC / 8:20 PST
|
- cron: '20 16 * * *' # run every day at 16:20 UTC / 8:20 PST
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_graphql_files:
|
update_graphql_files:
|
||||||
if: github.repository == 'github/docs-internal'
|
if: github.repository == 'github/docs-internal'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ env.FREEZE == 'true' }}
|
- if: ${{ env.FREEZE == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||||
exit 1 # prevents further steps from running
|
exit 1 # prevents further steps from running
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
|
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.4'
|
ruby-version: '2.4'
|
||||||
- name: Install Ruby dependencies
|
- name: Install Ruby dependencies
|
||||||
run: |
|
run: |
|
||||||
gem install bundler
|
gem install bundler
|
||||||
bundle install
|
bundle install
|
||||||
- name: Install Node.js dependencies
|
- name: Install Node.js dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run updater scripts
|
- name: Run updater scripts
|
||||||
env:
|
env:
|
||||||
# need to use a token from a user with access to github/github for this step
|
# need to use a token from a user with access to github/github for this step
|
||||||
GITHUB_TOKEN: ${{ secrets.ZEKE_PAT_WITH_REPO_AND_WORKFLOW_SCOPE_FOR_REPO_SYNC }}
|
GITHUB_TOKEN: ${{ secrets.ZEKE_PAT_WITH_REPO_AND_WORKFLOW_SCOPE_FOR_REPO_SYNC }}
|
||||||
# technically the changelog should only be updated once per day, but we can safely
|
run: |
|
||||||
# run build-changelog-from-markdown.js in its current form once per hour; when we
|
script/graphql/update-files.js
|
||||||
# rewrite the changelog script, we may need to run it in a separate workflow on a
|
- name: Create pull request
|
||||||
# once-per-day schedule; see details in https://github.com/github/docs-internal/issues/12722.
|
id: create-pull-request
|
||||||
run: |
|
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
||||||
script/graphql/update-files.js
|
with:
|
||||||
script/graphql/build-changelog-from-markdown.js
|
# need to use a token with repo and workflow scopes for this step
|
||||||
- name: Create pull request
|
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||||
id: create-pull-request
|
commit-message: 'Action ran graphql script"update-files"'
|
||||||
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
title: GraphQL schema update
|
||||||
with:
|
body:
|
||||||
# need to use a token with repo and workflow scopes for this step
|
"Hello! Some GraphQL data in github/github was updated recently. This PR
|
||||||
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
syncs up the GraphQL data in this repo.\n\n
|
||||||
commit-message: 'Action ran graphql scripts "update-files" and "build-changelog-from-markdown"'
|
If CI passes, this PR will be auto-merged. :green_heart:\n\n
|
||||||
title: GraphQL schema update
|
If CI does not pass or other problems arise, contact #docs-engineering on slack."
|
||||||
body: "Hello! Some GraphQL data in github/github was updated recently. This PR
|
labels: automerge
|
||||||
syncs up the GraphQL data in this repo.\n\n
|
branch: graphql-schema-update
|
||||||
If CI passes, this PR will be auto-merged. :green_heart:\n\n
|
- if: ${{ failure() }}
|
||||||
If CI does not pass or other problems arise, contact #docs-engineering on slack."
|
name: Delete remote branch (if previous steps failed)
|
||||||
labels: automerge
|
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
||||||
branch: graphql-schema-update
|
with:
|
||||||
- if: ${{ failure() }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
name: Delete remote branch (if previous steps failed)
|
branches: graphql-schema-update
|
||||||
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
- if: ${{ steps.create-pull-request.outputs.pr_number }}
|
||||||
with:
|
name: Approve
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
||||||
branches: graphql-schema-update
|
with:
|
||||||
- if: ${{ steps.create-pull-request.outputs.pr_number }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
name: Approve
|
number: ${{ steps.create-pull-request.outputs.pr_number }}
|
||||||
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
number: ${{ steps.create-pull-request.outputs.pr_number }}
|
|
||||||
|
|||||||
56
.github/workflows/yml-lint.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: Lint Yaml
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches-ignore:
|
||||||
|
- translations
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
see_if_should_skip:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
|
||||||
|
with:
|
||||||
|
cancel_others: 'false'
|
||||||
|
github_token: ${{ github.token }}
|
||||||
|
paths: '["**/*.yml", "**/*.yaml", "package*.json", ".github/workflows/yml-lint.yml"]'
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: see_if_should_skip
|
||||||
|
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
|
||||||
|
- name: Get npm cache directory
|
||||||
|
id: npm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||||
|
with:
|
||||||
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run linter
|
||||||
|
run: npx prettier -c "**/*.{yml,yaml}"
|
||||||
6
.gitignore
vendored
@@ -4,8 +4,6 @@
|
|||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
coverage
|
coverage
|
||||||
|
.linkinator
|
||||||
# blc: broken link checker
|
broken_links.md
|
||||||
blc_output.log
|
|
||||||
blc_output_internal.log
|
|
||||||
dist
|
dist
|
||||||
1
.prettierignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
translations/
|
||||||
12
.prettierrc.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files":[
|
||||||
|
"**/*.{yml,yaml}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"singleQuote": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ Examples of unacceptable behavior include:
|
|||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
* Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||||
|
* Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
## Enforcement Responsibilities
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ You can browse existing issues to find something that needs help!
|
|||||||
|
|
||||||
### Labels
|
### Labels
|
||||||
Labels can help you find an issue you'd like to help with.
|
Labels can help you find an issue you'd like to help with.
|
||||||
- The [`good-first-issue` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue) is for problems or updates we think are ideal for beginners.
|
- The [`help wanted` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) is for problems or updates that anyone in the community can start working on.
|
||||||
|
- The [`good first issue` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) is for problems or updates we think are ideal for beginners.
|
||||||
- The [`content` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Acontent) is for problems or updates in the content on docs.github.com. These will usually require some knowledge of Markdown.
|
- The [`content` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Acontent) is for problems or updates in the content on docs.github.com. These will usually require some knowledge of Markdown.
|
||||||
- The [`engineering` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Aengineering) is for problems or updates in the docs.github.com website. These will usually require some knowledge of JavaScript/Node.js or YAML to fix.
|
- The [`engineering` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Aengineering) is for problems or updates in the docs.github.com website. These will usually require some knowledge of JavaScript/Node.js or YAML to fix.
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ This repository contains the documentation website code and Markdown source file
|
|||||||
GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo.
|
GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo.
|
||||||
|
|
||||||
In this article:
|
In this article:
|
||||||
|
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
- [READMEs](#readmes)
|
- [READMEs](#readmes)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
@@ -34,6 +35,7 @@ If you have a solution to one of the open issues, you will need to fork the repo
|
|||||||
We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/github/docs/discussions).
|
We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/github/docs/discussions).
|
||||||
|
|
||||||
#### And that's it!
|
#### And that's it!
|
||||||
|
|
||||||
That's how you can get started easily as a member of the GitHub Documentation community. :sparkles:
|
That's how you can get started easily as a member of the GitHub Documentation community. :sparkles:
|
||||||
|
|
||||||
If you want to know more, or you're making a more complex contribution, check out [Getting Started with Contributing](/CONTRIBUTING.md).
|
If you want to know more, or you're making a more complex contribution, check out [Getting Started with Contributing](/CONTRIBUTING.md).
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 123 KiB |
BIN
assets/images/help/codespaces/choose-sku-vscode.png
Normal file
|
After Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 383 KiB |
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 545 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 406 KiB |
BIN
assets/images/help/desktop/discard-multiple-lines.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
assets/images/help/desktop/discard-single-line.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
assets/images/help/desktop/gear-diff-select.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 17 KiB |
BIN
assets/images/help/organizations/repositories-dialog.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 630 KiB |
BIN
assets/images/help/repository/commit-hello-world-file.png
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
assets/images/help/repository/manual-workflow-trigger.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
assets/images/help/repository/say-hello-job.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 39 KiB |
BIN
assets/images/help/repository/workflow-job-listing.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
assets/images/help/repository/workflow-log-listing.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
assets/images/help/repository/workflow-run-listing.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 34 KiB |
BIN
assets/images/help/settings/feature-preview-setting.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/help/settings/improved-container-support.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
@@ -32,8 +32,8 @@ You can build Docker container and JavaScript actions. Actions require a metadat
|
|||||||
| Type | Operating system |
|
| Type | Operating system |
|
||||||
| ---- | ------------------- |
|
| ---- | ------------------- |
|
||||||
| Docker container | Linux |
|
| Docker container | Linux |
|
||||||
| JavaScript | Linux, MacOS, Windows |
|
| JavaScript | Linux, macOS, Windows |
|
||||||
| Composite run steps | Linux, MacOS, Windows |
|
| Composite run steps | Linux, macOS, Windows |
|
||||||
|
|
||||||
#### Docker container actions
|
#### Docker container actions
|
||||||
|
|
||||||
|
|||||||
@@ -22,19 +22,19 @@ Docker and JavaScript actions require a metadata file. The metadata filename mus
|
|||||||
|
|
||||||
Action metadata files use YAML syntax. If you're new to YAML, you can read "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)."
|
Action metadata files use YAML syntax. If you're new to YAML, you can read "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)."
|
||||||
|
|
||||||
### **`name`**
|
### `name`
|
||||||
|
|
||||||
**Required** The name of your action. {% data variables.product.prodname_dotcom %} displays the `name` in the **Actions** tab to help visually identify actions in each job.
|
**Required** The name of your action. {% data variables.product.prodname_dotcom %} displays the `name` in the **Actions** tab to help visually identify actions in each job.
|
||||||
|
|
||||||
### **`author`**
|
### `author`
|
||||||
|
|
||||||
**Optional** The name of the action's author.
|
**Optional** The name of the action's author.
|
||||||
|
|
||||||
### **`description`**
|
### `description`
|
||||||
|
|
||||||
**Required** A short description of the action.
|
**Required** A short description of the action.
|
||||||
|
|
||||||
### **`inputs`**
|
### `inputs`
|
||||||
|
|
||||||
**Optional** Input parameters allow you to specify data that the action expects to use during runtime. {% data variables.product.prodname_dotcom %} stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.
|
**Optional** Input parameters allow you to specify data that the action expects to use during runtime. {% data variables.product.prodname_dotcom %} stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.
|
||||||
|
|
||||||
@@ -57,23 +57,23 @@ When you specify an input to an action in a workflow file or use a default input
|
|||||||
|
|
||||||
For example, if a workflow defined the numOctocats and octocatEyeColor inputs, the action code could read the values of the inputs using the `INPUT_NUMOCTOCATS` and `INPUT_OCTOCATEYECOLOR` environment variables.
|
For example, if a workflow defined the numOctocats and octocatEyeColor inputs, the action code could read the values of the inputs using the `INPUT_NUMOCTOCATS` and `INPUT_OCTOCATEYECOLOR` environment variables.
|
||||||
|
|
||||||
#### **`inputs.<input_id>`**
|
#### `inputs.<input_id>`
|
||||||
|
|
||||||
**Required** A `string` identifier to associate with the input. The value of `<input_id>` is a map of the input's metadata. The `<input_id>` must be a unique identifier within the `inputs` object. The `<input_id>` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
**Required** A `string` identifier to associate with the input. The value of `<input_id>` is a map of the input's metadata. The `<input_id>` must be a unique identifier within the `inputs` object. The `<input_id>` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
||||||
|
|
||||||
#### **`inputs.<input_id>.description`**
|
#### `inputs.<input_id>.description`
|
||||||
|
|
||||||
**Required** A `string` description of the input parameter.
|
**Required** A `string` description of the input parameter.
|
||||||
|
|
||||||
#### **`inputs.<input_id>.required`**
|
#### `inputs.<input_id>.required`
|
||||||
|
|
||||||
**Required** A `boolean` to indicate whether the action requires the input parameter. Set to `true` when the parameter is required.
|
**Required** A `boolean` to indicate whether the action requires the input parameter. Set to `true` when the parameter is required.
|
||||||
|
|
||||||
#### **`inputs.<input_id>.default`**
|
#### `inputs.<input_id>.default`
|
||||||
|
|
||||||
**Optional** A `string` representing the default value. The default value is used when an input parameter isn't specified in a workflow file.
|
**Optional** A `string` representing the default value. The default value is used when an input parameter isn't specified in a workflow file.
|
||||||
|
|
||||||
### **`outputs`**
|
### `outputs`
|
||||||
|
|
||||||
**Optional** Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.
|
**Optional** Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.
|
||||||
|
|
||||||
@@ -87,15 +87,15 @@ outputs:
|
|||||||
description: 'The sum of the inputs'
|
description: 'The sum of the inputs'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`outputs.<output_id>`**
|
#### `outputs.<output_id>`
|
||||||
|
|
||||||
**Required** A `string` identifier to associate with the output. The value of `<output_id>` is a map of the output's metadata. The `<output_id>` must be a unique identifier within the `outputs` object. The `<output_id>` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
**Required** A `string` identifier to associate with the output. The value of `<output_id>` is a map of the output's metadata. The `<output_id>` must be a unique identifier within the `outputs` object. The `<output_id>` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
||||||
|
|
||||||
#### **`outputs.<output_id>.description`**
|
#### `outputs.<output_id>.description`
|
||||||
|
|
||||||
**Required** A `string` description of the output parameter.
|
**Required** A `string` description of the output parameter.
|
||||||
|
|
||||||
### **`outputs`** for composite run steps actions
|
### `outputs` for composite run steps actions
|
||||||
|
|
||||||
**Optional** `outputs` use the same parameters as `outputs.<output_id>` and `outputs.<output_id>.description` (see "[`outputs` for {% data variables.product.prodname_actions %}](/actions/creating-actions/metadata-syntax-for-github-actions#outputs)"), but also includes the `value` token.
|
**Optional** `outputs` use the same parameters as `outputs.<output_id>` and `outputs.<output_id>.description` (see "[`outputs` for {% data variables.product.prodname_actions %}](/actions/creating-actions/metadata-syntax-for-github-actions#outputs)"), but also includes the `value` token.
|
||||||
|
|
||||||
@@ -116,12 +116,12 @@ runs:
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
#### **`outputs.<output_id.value>`**
|
#### `outputs.<output_id>.value`
|
||||||
**Required** The value that the output parameter will be mapped to. You can set this to a `string` or an expression with context. For example, you can use the `steps` context to set the `value` of an output to the output value of a step.
|
**Required** The value that the output parameter will be mapped to. You can set this to a `string` or an expression with context. For example, you can use the `steps` context to set the `value` of an output to the output value of a step.
|
||||||
|
|
||||||
For more information on how to use context and expression syntax, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)".
|
For more information on how to use context and expression syntax, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)".
|
||||||
|
|
||||||
### **`runs`** for JavaScript actions
|
### `runs` for JavaScript actions
|
||||||
|
|
||||||
**Required** Configures the path to the action's code and the application used to execute the code.
|
**Required** Configures the path to the action's code and the application used to execute the code.
|
||||||
|
|
||||||
@@ -133,15 +133,15 @@ runs:
|
|||||||
main: 'main.js'
|
main: 'main.js'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`runs.using`**
|
#### `runs.using`
|
||||||
|
|
||||||
**Required** The application used to execute the code specified in [`main`](#runsmain).
|
**Required** The application used to execute the code specified in [`main`](#runsmain).
|
||||||
|
|
||||||
#### **`runs.main`**
|
#### `runs.main`
|
||||||
|
|
||||||
**Required** The file that contains your action code. The application specified in [`using`](#runsusing) executes this file.
|
**Required** The file that contains your action code. The application specified in [`using`](#runsusing) executes this file.
|
||||||
|
|
||||||
#### **`pre`**
|
#### `pre`
|
||||||
|
|
||||||
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ runs:
|
|||||||
post: 'cleanup.js'
|
post: 'cleanup.js'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`pre-if`**
|
#### `pre-if`
|
||||||
|
|
||||||
**Optional** Allows you to define conditions for the `pre:` action execution. The `pre:` action will only run if the conditions in `pre-if` are met. If not set, then `pre-if` defaults to `always()`.
|
**Optional** Allows you to define conditions for the `pre:` action execution. The `pre:` action will only run if the conditions in `pre-if` are met. If not set, then `pre-if` defaults to `always()`.
|
||||||
Note that the `step` context is unavailable, as no steps have run yet.
|
Note that the `step` context is unavailable, as no steps have run yet.
|
||||||
@@ -167,7 +167,7 @@ In this example, `cleanup.js` only runs on Linux-based runners:
|
|||||||
pre-if: 'runner.os == linux'
|
pre-if: 'runner.os == linux'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`post`**
|
#### `post`
|
||||||
|
|
||||||
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the [`using`](#runsusing) syntax will execute this file.
|
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the [`using`](#runsusing) syntax will execute this file.
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ runs:
|
|||||||
|
|
||||||
The `post:` action always runs by default but you can override this using `post-if`.
|
The `post:` action always runs by default but you can override this using `post-if`.
|
||||||
|
|
||||||
#### **`post-if`**
|
#### `post-if`
|
||||||
|
|
||||||
**Optional** Allows you to define conditions for the `post:` action execution. The `post:` action will only run if the conditions in `post-if` are met. If not set, then `post-if` defaults to `always()`.
|
**Optional** Allows you to define conditions for the `post:` action execution. The `post:` action will only run if the conditions in `post-if` are met. If not set, then `post-if` defaults to `always()`.
|
||||||
|
|
||||||
@@ -193,19 +193,19 @@ For example, this `cleanup.js` will only run on Linux-based runners:
|
|||||||
post-if: 'runner.os == linux'
|
post-if: 'runner.os == linux'
|
||||||
```
|
```
|
||||||
|
|
||||||
### **`runs`** for composite run steps actions
|
### `runs` for composite run steps actions
|
||||||
|
|
||||||
**Required** Configures the path to the composite action, and the application used to execute the code.
|
**Required** Configures the path to the composite action, and the application used to execute the code.
|
||||||
|
|
||||||
#### **`runs.using`**
|
#### `runs.using`
|
||||||
|
|
||||||
**Required** To use a composite run steps action, set this to `"composite"`.
|
**Required** To use a composite run steps action, set this to `"composite"`.
|
||||||
|
|
||||||
#### **`runs.steps`**
|
#### `runs.steps`
|
||||||
|
|
||||||
**Required** The run steps that you plan to run in this action.
|
**Required** The run steps that you plan to run in this action.
|
||||||
|
|
||||||
##### **`runs.steps.run`**
|
##### `runs.steps.run`
|
||||||
|
|
||||||
**Required** The command you want to run. This can be inline or a script in your action repository:
|
**Required** The command you want to run. This can be inline or a script in your action repository:
|
||||||
```yaml
|
```yaml
|
||||||
@@ -228,27 +228,27 @@ runs:
|
|||||||
|
|
||||||
For more information, see "[`github context`](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)".
|
For more information, see "[`github context`](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)".
|
||||||
|
|
||||||
##### **`runs.steps.shell`**
|
##### `runs.steps.shell`
|
||||||
|
|
||||||
**Required** The shell where you want to run the command. You can use any of the shells listed [here](/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell).
|
**Required** The shell where you want to run the command. You can use any of the shells listed [here](/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell).
|
||||||
|
|
||||||
##### **`runs.steps.name`**
|
##### `runs.steps.name`
|
||||||
|
|
||||||
**Optional** The name of the composite run step.
|
**Optional** The name of the composite run step.
|
||||||
|
|
||||||
##### **`runs.steps.id`**
|
##### `runs.steps.id`
|
||||||
|
|
||||||
**Optional** A unique identifier for the step. You can use the `id` to reference the step in contexts. For more information, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)".
|
**Optional** A unique identifier for the step. You can use the `id` to reference the step in contexts. For more information, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)".
|
||||||
|
|
||||||
##### **`runs.steps.env`**
|
##### `runs.steps.env`
|
||||||
|
|
||||||
**Optional** Sets a `map` of environment variables for only that step. If you want to modify the environment variable stored in the workflow, use {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`echo "{name}={value}" >> $GITHUB_ENV`{% else %}`echo "::set-env name={name}::{value}"`{% endif %} in a composite run step.
|
**Optional** Sets a `map` of environment variables for only that step. If you want to modify the environment variable stored in the workflow, use {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`echo "{name}={value}" >> $GITHUB_ENV`{% else %}`echo "::set-env name={name}::{value}"`{% endif %} in a composite run step.
|
||||||
|
|
||||||
##### **`runs.steps.working-directory`**
|
##### `runs.steps.working-directory`
|
||||||
|
|
||||||
**Optional** Specifies the working directory where the command is run.
|
**Optional** Specifies the working directory where the command is run.
|
||||||
|
|
||||||
### **`runs`** for Docker actions
|
### `runs` for Docker actions
|
||||||
|
|
||||||
**Required** Configures the image used for the Docker action.
|
**Required** Configures the image used for the Docker action.
|
||||||
|
|
||||||
@@ -268,11 +268,11 @@ runs:
|
|||||||
image: 'docker://debian:stretch-slim'
|
image: 'docker://debian:stretch-slim'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`runs.using`**
|
#### `runs.using`
|
||||||
|
|
||||||
**Required** You must set this value to `'docker'`.
|
**Required** You must set this value to `'docker'`.
|
||||||
|
|
||||||
#### **`pre-entrypoint`**
|
#### `pre-entrypoint`
|
||||||
|
|
||||||
**Optional** Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. {% data variables.product.prodname_actions %} uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
**Optional** Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. {% data variables.product.prodname_actions %} uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
||||||
|
|
||||||
@@ -290,21 +290,21 @@ runs:
|
|||||||
entrypoint: 'main.sh'
|
entrypoint: 'main.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`runs.image`**
|
#### `runs.image`
|
||||||
|
|
||||||
**Required** The Docker image to use as the container to run the action. The value can be the Docker base image name, a local `Dockerfile` in your repository, or a public image in Docker Hub or another registry. To reference a `Dockerfile` local to your repository, use a path relative to your action metadata file. The `docker` application will execute this file.
|
**Required** The Docker image to use as the container to run the action. The value can be the Docker base image name, a local `Dockerfile` in your repository, or a public image in Docker Hub or another registry. To reference a `Dockerfile` local to your repository, use a path relative to your action metadata file. The `docker` application will execute this file.
|
||||||
|
|
||||||
#### **`runs.env`**
|
#### `runs.env`
|
||||||
|
|
||||||
**Optional** Specifies a key/value map of environment variables to set in the container environment.
|
**Optional** Specifies a key/value map of environment variables to set in the container environment.
|
||||||
|
|
||||||
#### **`runs.entrypoint`**
|
#### `runs.entrypoint`
|
||||||
|
|
||||||
**Optional** Overrides the Docker `ENTRYPOINT` in the `Dockerfile`, or sets it if one wasn't already specified. Use `entrypoint` when the `Dockerfile` does not specify an `ENTRYPOINT` or you want to override the `ENTRYPOINT` instruction. If you omit `entrypoint`, the commands you specify in the Docker `ENTRYPOINT` instruction will execute. The Docker `ENTRYPOINT` instruction has a _shell_ form and _exec_ form. The Docker `ENTRYPOINT` documentation recommends using the _exec_ form of the `ENTRYPOINT` instruction.
|
**Optional** Overrides the Docker `ENTRYPOINT` in the `Dockerfile`, or sets it if one wasn't already specified. Use `entrypoint` when the `Dockerfile` does not specify an `ENTRYPOINT` or you want to override the `ENTRYPOINT` instruction. If you omit `entrypoint`, the commands you specify in the Docker `ENTRYPOINT` instruction will execute. The Docker `ENTRYPOINT` instruction has a _shell_ form and _exec_ form. The Docker `ENTRYPOINT` documentation recommends using the _exec_ form of the `ENTRYPOINT` instruction.
|
||||||
|
|
||||||
For more information about how the `entrypoint` executes, see "[Dockerfile support for {% data variables.product.prodname_actions %}](/actions/creating-actions/dockerfile-support-for-github-actions/#entrypoint)."
|
For more information about how the `entrypoint` executes, see "[Dockerfile support for {% data variables.product.prodname_actions %}](/actions/creating-actions/dockerfile-support-for-github-actions/#entrypoint)."
|
||||||
|
|
||||||
#### **`post-entrypoint`**
|
#### `post-entrypoint`
|
||||||
|
|
||||||
**Optional** Allows you to run a cleanup script once the `runs.entrypoint` action has completed. {% data variables.product.prodname_actions %} uses `docker run` to launch this action. Because {% data variables.product.prodname_actions %} runs the script inside a new container using the same base image, the runtime state is different from the main `entrypoint` container. You can access any state you need in either the workspace, `HOME`, or as a `STATE_` variable. The `post-entrypoint:` action always runs by default but you can override this using [`post-if`](#post-if).
|
**Optional** Allows you to run a cleanup script once the `runs.entrypoint` action has completed. {% data variables.product.prodname_actions %} uses `docker run` to launch this action. Because {% data variables.product.prodname_actions %} runs the script inside a new container using the same base image, the runtime state is different from the main `entrypoint` container. You can access any state you need in either the workspace, `HOME`, or as a `STATE_` variable. The `post-entrypoint:` action always runs by default but you can override this using [`post-if`](#post-if).
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ runs:
|
|||||||
post-entrypoint: 'cleanup.sh'
|
post-entrypoint: 'cleanup.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`runs.args`**
|
#### `runs.args`
|
||||||
|
|
||||||
**Optional** An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. {% data variables.product.prodname_dotcom %} passes the `args` to the container's `ENTRYPOINT` when the container starts up.
|
**Optional** An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. {% data variables.product.prodname_dotcom %} passes the `args` to the container's `ENTRYPOINT` when the container starts up.
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ runs:
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
### **`branding`**
|
### `branding`
|
||||||
|
|
||||||
You can use a color and [Feather](https://feathericons.com/) icon to create a badge to personalize and distinguish your action. Badges are shown next to your action name in [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace?type=actions).
|
You can use a color and [Feather](https://feathericons.com/) icon to create a badge to personalize and distinguish your action. Badges are shown next to your action name in [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace?type=actions).
|
||||||
|
|
||||||
@@ -356,11 +356,11 @@ branding:
|
|||||||
color: 'green'
|
color: 'green'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### **`branding.color`**
|
#### `branding.color`
|
||||||
|
|
||||||
The background color of the badge. Can be one of: `white`, `yellow`, `blue`, `green`, `orange`, `red`, `purple`, or `gray-dark`.
|
The background color of the badge. Can be one of: `white`, `yellow`, `blue`, `green`, `orange`, `red`, `purple`, or `gray-dark`.
|
||||||
|
|
||||||
#### **`branding.icon`**
|
#### `branding.icon`
|
||||||
|
|
||||||
The name of the [Feather](https://feathericons.com/) icon to use.
|
The name of the [Feather](https://feathericons.com/) icon to use.
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ steps:
|
|||||||
|
|
||||||
### Caching dependencies
|
### Caching dependencies
|
||||||
|
|
||||||
You can cache your dependencies to speed up your workflow runs. After a successful run, your local Gradle package cache will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote package repositories. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache your dependencies to speed up your workflow runs. After a successful run, your local Gradle package cache will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote package repositories. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ steps:
|
|||||||
|
|
||||||
### Caching dependencies
|
### Caching dependencies
|
||||||
|
|
||||||
You can cache your dependencies to speed up your workflow runs. After a successful run, your local Maven repository will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote Maven repositories. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache your dependencies to speed up your workflow runs. After a successful run, your local Maven repository will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote Maven repositories. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ If you don't specify a Node.js version, {% data variables.product.prodname_dotco
|
|||||||
|
|
||||||
{% data variables.product.prodname_dotcom %}-hosted runners have npm and Yarn dependency managers installed. You can use npm and Yarn to install dependencies in your workflow before building and testing your code. The Windows and Linux {% data variables.product.prodname_dotcom %}-hosted runners also have Grunt, Gulp, and Bower installed.
|
{% data variables.product.prodname_dotcom %}-hosted runners have npm and Yarn dependency managers installed. You can use npm and Yarn to install dependencies in your workflow before building and testing your code. The Windows and Linux {% data variables.product.prodname_dotcom %}-hosted runners also have Grunt, Gulp, and Bower installed.
|
||||||
|
|
||||||
You can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
#### Example using npm
|
#### Example using npm
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ always-auth=true
|
|||||||
|
|
||||||
#### Example caching dependencies
|
#### Example caching dependencies
|
||||||
|
|
||||||
You can cache dependencies using a unique key, and restore the dependencies when you run future workflows using the `cache` action. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache dependencies using a unique key, and restore the dependencies when you run future workflows using the `cache` action. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ product: '{% data reusables.gated-features.actions %}'
|
|||||||
versions:
|
versions:
|
||||||
free-pro-team: '*'
|
free-pro-team: '*'
|
||||||
enterprise-server: '>=2.22'
|
enterprise-server: '>=2.22'
|
||||||
|
authors:
|
||||||
|
- potatoqualitee
|
||||||
---
|
---
|
||||||
|
|
||||||
{% data reusables.actions.enterprise-beta %}
|
{% data reusables.actions.enterprise-beta %}
|
||||||
@@ -89,7 +91,7 @@ The table below describes the locations for various PowerShell modules in each {
|
|||||||
|
|
||||||
{% endnote %}
|
{% endnote %}
|
||||||
|
|
||||||
You can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
For example, the following job installs the `SqlServer` and `PSScriptAnalyzer` modules:
|
For example, the following job installs the `SqlServer` and `PSScriptAnalyzer` modules:
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ jobs:
|
|||||||
|
|
||||||
#### Caching dependencies
|
#### Caching dependencies
|
||||||
|
|
||||||
You can cache PowerShell dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache PowerShell dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
PowerShell caches its dependencies in different locations, depending on the runner's operating system. For example, the `path` location used in the following Ubuntu example will be different for a Windows operating system.
|
PowerShell caches its dependencies in different locations, depending on the runner's operating system. For example, the `path` location used in the following Ubuntu example will be different for a Windows operating system.
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ We recommend using `setup-python` to configure the version of Python used in you
|
|||||||
|
|
||||||
{% data variables.product.prodname_dotcom %}-hosted runners have the pip package manager installed. You can use pip to install dependencies from the PyPI package registry before building and testing your code. For example, the YAML below installs or upgrades the `pip` package installer and the `setuptools` and `wheel` packages.
|
{% data variables.product.prodname_dotcom %}-hosted runners have the pip package manager installed. You can use pip to install dependencies from the PyPI package registry before building and testing your code. For example, the YAML below installs or upgrades the `pip` package installer and the `setuptools` and `wheel` packages.
|
||||||
|
|
||||||
You can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
@@ -228,7 +228,7 @@ steps:
|
|||||||
|
|
||||||
#### Caching Dependencies
|
#### Caching Dependencies
|
||||||
|
|
||||||
You can cache pip dependencies using a unique key, and restore the dependencies when you run future workflows using the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache pip dependencies using a unique key, and restore the dependencies when you run future workflows using the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example below depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip).
|
Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example below depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip).
|
||||||
|
|
||||||
|
|||||||
318
content/actions/guides/building-and-testing-ruby.md
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
---
|
||||||
|
title: Building and testing Ruby
|
||||||
|
intro: You can create a continuous integration (CI) workflow to build and test your Ruby project.
|
||||||
|
product: '{% data reusables.gated-features.actions %}'
|
||||||
|
versions:
|
||||||
|
free-pro-team: '*'
|
||||||
|
enterprise-server: '>=2.22'
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.actions.enterprise-beta %}
|
||||||
|
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||||
|
|
||||||
|
### Introduction
|
||||||
|
|
||||||
|
This guide shows you how to create a continuous integration (CI) workflow that builds and tests a Ruby application. If your CI tests pass, you may want to deploy your code or publish a gem.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
We recommend that you have a basic understanding of Ruby, YAML, workflow configuration options, and how to create a workflow file. For more information, see:
|
||||||
|
|
||||||
|
- [Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)
|
||||||
|
- [Ruby in 20 minutes](https://www.ruby-lang.org/en/documentation/quickstart/)
|
||||||
|
|
||||||
|
### Starting with the Ruby workflow template
|
||||||
|
|
||||||
|
{% data variables.product.prodname_dotcom %} provides a Ruby workflow template that will work for most Ruby projects. For more information, see the [Ruby workflow template](https://github.com/actions/starter-workflows/blob/master/ci/ruby.yml).
|
||||||
|
|
||||||
|
To get started quickly, add the template to the `.github/workflows` directory of your repository.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
name: Ruby
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby
|
||||||
|
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
||||||
|
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
||||||
|
# uses: ruby/setup-ruby@v1
|
||||||
|
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bundle install
|
||||||
|
- name: Run tests
|
||||||
|
run: bundle exec rake
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
### Specifying the Ruby version
|
||||||
|
|
||||||
|
The easiest way to specify a Ruby version is by using the `ruby/setup-ruby` action provided by the Ruby organization on GitHub. The action adds any supported Ruby version to `PATH` for each job run in a workflow. For more information see, the [`ruby/setup-ruby`](https://github.com/ruby/setup-ruby).
|
||||||
|
|
||||||
|
Using either Ruby's `ruby/setup-ruby` action or GitHub's `actions/setup-ruby` action is the recommended way of using Ruby with GitHub Actions because it ensures consistent behavior across different runners and different versions of Ruby.
|
||||||
|
|
||||||
|
The `setup-ruby` action takes a Ruby version as an input and configures that version on the runner.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6 # Not needed with a .ruby-version file
|
||||||
|
- run: bundle install
|
||||||
|
- run: bundle exec rake
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
Alternatively, you can check a `.ruby-version` file into the root of your repository and `setup-ruby` will use the version defined in that file.
|
||||||
|
|
||||||
|
### Testing with multiple versions of Ruby
|
||||||
|
|
||||||
|
You can add a matrix strategy to run your workflow with more than one version of Ruby. For example, you can test your code against the latest patch releases of versions 2.7, 2.6, and 2.5. The 'x' is a wildcard character that matches the latest patch release available for a version.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ruby-version: [2.7.x, 2.6.x, 2.5.x]
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
Each version of Ruby specified in the `ruby-version` array creates a job that runs the same steps. The {% raw %}`${{ matrix.ruby-version }}`{% endraw %} context is used to access the current job's version. For more information about matrix strategies and contexts, see "Workflow syntax for GitHub Actions" and "Context and expression syntax for GitHub Actions."
|
||||||
|
|
||||||
|
The full updated workflow with a matrix strategy could look like this:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
name: Ruby CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ruby-version: [2.7.x, 2.6.x, 2.5.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
||||||
|
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
||||||
|
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
||||||
|
# uses: ruby/setup-ruby@v1
|
||||||
|
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ matrix.ruby-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bundle install
|
||||||
|
- name: Run tests
|
||||||
|
run: bundle exec rake
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
### Installing dependencies with Bundler
|
||||||
|
|
||||||
|
The `setup-ruby` action will automatically install bundler for you. The version is determined by your `gemfile.lock` file. If no version is present in your lockfile, then the latest compatible version will be installed.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
- run: bundle install
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
#### Caching dependencies
|
||||||
|
|
||||||
|
If you are using {% data variables.product.prodname_dotcom %}-hosted runners, the `setup-ruby` actions provides a method to automatically handle the caching of your gems between runs.
|
||||||
|
|
||||||
|
To enable caching, set the following.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
bundler-cache: true
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
This will configure bundler to install your gems to `vendor/cache`. For each successful run of your workflow, this folder will be cached by Actions and re-downloaded for subsequent workflow runs. A hash of your gemfile.lock and the Ruby version are used as the cache key. If you install any new gems, or change a version, the cache will be invalidated and bundler will do a fresh install.
|
||||||
|
|
||||||
|
**Caching without setup-ruby**
|
||||||
|
|
||||||
|
For greater control over caching, if you are using {% data variables.product.prodname_dotcom %}-hosted runners, you can use the `actions/cache` Action directly. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: vendor/bundle
|
||||||
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gems-
|
||||||
|
- name: Bundle install
|
||||||
|
run: |
|
||||||
|
bundle config path vendor/bundle
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
If you're using a matrix build, you will want to include the matrix variables in your cache key. For example, if you have a matrix strategy for different ruby versions (`matrix.ruby-version`) and different operating systems (`matrix.os`), your workflow steps might look like this:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: vendor/bundle
|
||||||
|
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-
|
||||||
|
- name: Bundle install
|
||||||
|
run: |
|
||||||
|
bundle config path vendor/bundle
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
### Matrix testing your code
|
||||||
|
|
||||||
|
The following example matrix tests all stable releases and head versions of MRI, JRuby and TruffleRuby on Ubuntu and macOS.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
name: Matrix Testing
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ${{ matrix.os }}-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu, macos]
|
||||||
|
ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||||
|
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
- run: bundle install
|
||||||
|
- run: bundle exec rake
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
### Linting your code
|
||||||
|
|
||||||
|
The following example installs `rubocop` and uses it to lint all files. For more information, see [Rubocop](https://github.com/rubocop-hq/rubocop). You can [configure Rubocop](https://docs.rubocop.org/rubocop/configuration.html) to decide on the specific linting rules.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
name: Linting
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
- run: bundle install
|
||||||
|
- name: Rubocop
|
||||||
|
run: rubocop
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
### Publishing Gems
|
||||||
|
|
||||||
|
You can configure your workflow to publish your Ruby package to any package registry you'd like when your CI tests pass.
|
||||||
|
|
||||||
|
You can store any access tokens or credentials needed to publish your package using repository secrets. The following example creates and publishes a package to `GitHub Package Registry` and `RubyGems`.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
|
||||||
|
name: Ruby Gem
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Manually publish
|
||||||
|
workflow_dispatch:
|
||||||
|
# Alternatively, publish whenever changes are merged to the default branch.
|
||||||
|
push:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build + Publish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby 2.6
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
- run: bundle install
|
||||||
|
|
||||||
|
- name: Publish to GPR
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.gem
|
||||||
|
touch $HOME/.gem/credentials
|
||||||
|
chmod 0600 $HOME/.gem/credentials
|
||||||
|
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
||||||
|
gem build *.gemspec
|
||||||
|
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
||||||
|
env:
|
||||||
|
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
||||||
|
OWNER: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
- name: Publish to RubyGems
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.gem
|
||||||
|
touch $HOME/.gem/credentials
|
||||||
|
chmod 0600 $HOME/.gem/credentials
|
||||||
|
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
||||||
|
gem build *.gemspec
|
||||||
|
gem push *.gem
|
||||||
|
env:
|
||||||
|
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ You can use {% data variables.product.prodname_actions %} to create custom conti
|
|||||||
{% link_in_list /building-and-testing-nodejs %}
|
{% link_in_list /building-and-testing-nodejs %}
|
||||||
{% link_in_list /building-and-testing-powershell %}
|
{% link_in_list /building-and-testing-powershell %}
|
||||||
{% link_in_list /building-and-testing-python %}
|
{% link_in_list /building-and-testing-python %}
|
||||||
|
{% link_in_list /building-and-testing-ruby %}
|
||||||
{% link_in_list /building-and-testing-java-with-maven %}
|
{% link_in_list /building-and-testing-java-with-maven %}
|
||||||
{% link_in_list /building-and-testing-java-with-gradle %}
|
{% link_in_list /building-and-testing-java-with-gradle %}
|
||||||
{% link_in_list /building-and-testing-java-with-ant %}
|
{% link_in_list /building-and-testing-java-with-ant %}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ The `retention-days` value cannot exceed the retention limit set by the reposito
|
|||||||
|
|
||||||
During a workflow run, you can use the [`download-artifact`](https://github.com/actions/download-artifact)action to download artifacts that were previously uploaded in the same workflow run.
|
During a workflow run, you can use the [`download-artifact`](https://github.com/actions/download-artifact)action to download artifacts that were previously uploaded in the same workflow run.
|
||||||
|
|
||||||
After a workflow run has been completed, you can download or delete artifacts on {% data variables.product.prodname_dotcom %} or using the REST API. For more information, see "[Downloading workflow artifacts](/actions/managing-workflow-runs/downloading-workflow-artifacts)," "[Removing workflow artifacts](/actions/managing-workflow-runs/removing-workflow-artifacts)," and the "[Artifacts REST API](/v3/actions/artifacts/)."
|
After a workflow run has been completed, you can download or delete artifacts on {% data variables.product.prodname_dotcom %} or using the REST API. For more information, see "[Downloading workflow artifacts](/actions/managing-workflow-runs/downloading-workflow-artifacts)," "[Removing workflow artifacts](/actions/managing-workflow-runs/removing-workflow-artifacts)," and the "[Artifacts REST API](/rest/reference/actions#artifacts)."
|
||||||
|
|
||||||
#### Downloading artifacts during a workflow run
|
#### Downloading artifacts during a workflow run
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ The following operating systems are supported for the self-hosted runner applica
|
|||||||
- Windows Server 2016 64-bit
|
- Windows Server 2016 64-bit
|
||||||
- Windows Server 2019 64-bit
|
- Windows Server 2019 64-bit
|
||||||
|
|
||||||
#### MacOS
|
#### macOS
|
||||||
|
|
||||||
- macOS 10.13 (High Sierra) or later
|
- macOS 10.13 (High Sierra) or later
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ All organizations have a single default self-hosted runner group. Organizations
|
|||||||
|
|
||||||
Self-hosted runners are automatically assigned to the default group when created, and can only be members of one group at a time. You can move a runner from the default group to any group you create.
|
Self-hosted runners are automatically assigned to the default group when created, and can only be members of one group at a time. You can move a runner from the default group to any group you create.
|
||||||
|
|
||||||
When creating a group, you must choose a policy that defines which repositories have access to the runner group. You can configure a runner group to be accessible to a specific list of repositories, all private repositories, or all repositories in the organization.
|
When creating a group, you must choose a policy that defines which repositories have access to the runner group.
|
||||||
|
|
||||||
{% data reusables.organizations.navigate-to-org %}
|
{% data reusables.organizations.navigate-to-org %}
|
||||||
{% data reusables.organizations.org_settings %}
|
{% data reusables.organizations.org_settings %}
|
||||||
@@ -41,9 +41,21 @@ When creating a group, you must choose a policy that defines which repositories
|
|||||||
1. In the **Self-hosted runners** section, click **Add new**, and then **New group**.
|
1. In the **Self-hosted runners** section, click **Add new**, and then **New group**.
|
||||||
|
|
||||||

|

|
||||||
1. Enter a name for your runner group, and select an access policy from the **Repository access** dropdown list.
|
1. Enter a name for your runner group, and assign a policy for repository access.
|
||||||
|
|
||||||

|
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %} You can configure a runner group to be accessible to a specific list of repositories, or to all repositories in the organization. By default, public repositories can't access runners in a runner group, but you can use the **Allow public repositories** option to override this.{% else if currentVersion == "enterprise-server@2.22"%}You can configure a runner group to be accessible to a specific list of repositories, all private repositories, or all repositories in the organization.{% endif %}
|
||||||
|
|
||||||
|
{% warning %}
|
||||||
|
|
||||||
|
**Warning**
|
||||||
|
|
||||||
|
{% indented_data_reference site.data.reusables.github-actions.self-hosted-runner-security spaces=3 %}
|
||||||
|
|
||||||
|
For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)."
|
||||||
|
|
||||||
|
{% endwarning %}
|
||||||
|
|
||||||
|

|
||||||
1. Click **Save group** to create the group and apply the policy.
|
1. Click **Save group** to create the group and apply the policy.
|
||||||
|
|
||||||
### Creating a self-hosted runner group for an enterprise
|
### Creating a self-hosted runner group for an enterprise
|
||||||
@@ -52,7 +64,7 @@ Enterprises can add their self-hosted runners to groups for access management. E
|
|||||||
|
|
||||||
Self-hosted runners are automatically assigned to the default group when created, and can only be members of one group at a time. You can assign the runner to a specific group during the registration process, or you can later move the runner from the default group to a custom group.
|
Self-hosted runners are automatically assigned to the default group when created, and can only be members of one group at a time. You can assign the runner to a specific group during the registration process, or you can later move the runner from the default group to a custom group.
|
||||||
|
|
||||||
When creating a group, you must choose a policy that grants access to all organizations in the enterprise or choose specific organizations.
|
When creating a group, you must choose a policy that defines which organizations have access to the runner group.
|
||||||
|
|
||||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||||
{% data reusables.enterprise-accounts.policies-tab %}
|
{% data reusables.enterprise-accounts.policies-tab %}
|
||||||
@@ -61,7 +73,19 @@ When creating a group, you must choose a policy that grants access to all organi
|
|||||||
1. Click **Add new**, and then **New group**.
|
1. Click **Add new**, and then **New group**.
|
||||||
|
|
||||||

|

|
||||||
1. Enter a name for your runner group, and select an access policy from the **Organization access** dropdown list.
|
1. Enter a name for your runner group, and assign a policy for organization access.
|
||||||
|
|
||||||
|
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %} You can configure a runner group to be accessible to a specific list of organizations, or all organizations in the enterprise. By default, public repositories can't access runners in a runner group, but you can use the **Allow public repositories** option to override this.{% else if currentVersion == "enterprise-server@2.22"%}You can configure a runner group to be accessible to all organizations in the enterprise or choose specific organizations.{% endif %}
|
||||||
|
|
||||||
|
{% warning %}
|
||||||
|
|
||||||
|
**Warning**
|
||||||
|
|
||||||
|
{% indented_data_reference site.data.reusables.github-actions.self-hosted-runner-security spaces=3 %}
|
||||||
|
|
||||||
|
For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)."
|
||||||
|
|
||||||
|
{% endwarning %}
|
||||||
|
|
||||||

|

|
||||||
1. Click **Save group** to create the group and apply the policy.
|
1. Click **Save group** to create the group and apply the policy.
|
||||||
|
|||||||
@@ -7,27 +7,37 @@ introLinks:
|
|||||||
reference: /actions/reference
|
reference: /actions/reference
|
||||||
featuredLinks:
|
featuredLinks:
|
||||||
guides:
|
guides:
|
||||||
- /actions/guides/setting-up-continuous-integration-using-workflow-templates
|
- /actions/learn-github-actions
|
||||||
|
- /actions/guides/about-continuous-integration
|
||||||
- /actions/guides/about-packaging-with-github-actions
|
- /actions/guides/about-packaging-with-github-actions
|
||||||
gettingStarted:
|
gettingStarted:
|
||||||
- /actions/managing-workflow-runs
|
- /actions/managing-workflow-runs
|
||||||
- /actions/hosting-your-own-runners
|
- /actions/hosting-your-own-runners
|
||||||
|
guideCards:
|
||||||
|
- /actions/guides/setting-up-continuous-integration-using-workflow-templates
|
||||||
|
- /actions/guides/publishing-nodejs-packages
|
||||||
|
- /actions/guides/building-and-testing-powershell
|
||||||
popular:
|
popular:
|
||||||
- /actions/reference/workflow-syntax-for-github-actions
|
- /actions/reference/workflow-syntax-for-github-actions
|
||||||
- /actions/reference/events-that-trigger-workflows
|
- /actions/reference/events-that-trigger-workflows
|
||||||
|
- /actions/learn-github-actions
|
||||||
|
- /actions/reference/context-and-expression-syntax-for-github-actions
|
||||||
|
- /actions/reference/workflow-commands-for-github-actions
|
||||||
|
- /actions/reference/environment-variables
|
||||||
changelog:
|
changelog:
|
||||||
|
- title: Removing set-env and add-path commands on November 16
|
||||||
|
date: '2020-11-09'
|
||||||
|
href: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
|
||||||
|
- title: Ubuntu-latest workflows will use Ubuntu-20.04
|
||||||
|
date: '2020-10-29'
|
||||||
|
href: https://github.blog/changelog/2020-10-29-github-actions-ubuntu-latest-workflows-will-use-ubuntu-20-04
|
||||||
|
- title: MacOS Big Sur Preview
|
||||||
|
date: '2020-10-29'
|
||||||
|
href: https://github.blog/changelog/2020-10-29-github-actions-macos-big-sur-preview
|
||||||
- title: Self-Hosted Runner Group Access Changes
|
- title: Self-Hosted Runner Group Access Changes
|
||||||
date: '2020-10-16'
|
date: '2020-10-16'
|
||||||
href: https://github.blog/changelog/2020-10-16-github-actions-self-hosted-runner-group-access-changes/
|
href: https://github.blog/changelog/2020-10-16-github-actions-self-hosted-runner-group-access-changes/
|
||||||
- title: Ability to change retention days for artifacts and logs
|
|
||||||
date: '2020-10-08'
|
|
||||||
href: https://github.blog/changelog/2020-10-08-github-actions-ability-to-change-retention-days-for-artifacts-and-logs
|
|
||||||
- title: Deprecating set-env and add-path commands
|
|
||||||
date: '2020-10-01'
|
|
||||||
href: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands
|
|
||||||
- title: Fine-tune access to external actions
|
|
||||||
date: '2020-10-01'
|
|
||||||
href: https://github.blog/changelog/2020-10-01-github-actions-fine-tune-access-to-external-actions
|
|
||||||
redirect_from:
|
redirect_from:
|
||||||
- /articles/automating-your-workflow-with-github-actions/
|
- /articles/automating-your-workflow-with-github-actions/
|
||||||
- /articles/customizing-your-project-with-github-actions/
|
- /articles/customizing-your-project-with-github-actions/
|
||||||
@@ -50,107 +60,26 @@ versions:
|
|||||||
<!-- {% link_with_intro /reference %} -->
|
<!-- {% link_with_intro /reference %} -->
|
||||||
|
|
||||||
<!-- Code examples -->
|
<!-- Code examples -->
|
||||||
|
{% assign actionsCodeExamples = site.data.variables.action_code_examples %}
|
||||||
|
{% if actionsCodeExamples %}
|
||||||
<div class="my-6 pt-6">
|
<div class="my-6 pt-6">
|
||||||
<h2 class="mb-2">More guides</h2>
|
<h2 class="mb-2 font-mktg h1">Code examples</h2>
|
||||||
|
|
||||||
<div class="d-flex flex-wrap gutter">
|
<div class="pr-lg-3 mb-5 mt-3">
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
<input class="js-code-example-filter input-lg py-2 px-3 col-12 col-lg-8 form-control" placeholder="Search code examples" type="search" autocomplete="off" aria-label="Search code examples"/>
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/building-and-testing-nodejs">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Building and testing Node.js</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to power CI in your Node.js application.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">JavaScript/TypeScript</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/building-and-testing-nodejs</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/building-and-testing-python">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Building and testing Python</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to power CI in your Python application.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">Python</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/building-and-testing-python</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/building-and-testing-java-with-maven">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Building and testing Java with Maven</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to power CI in your Java project with Maven.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">Java</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/building-and-testing-java-with-maven</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/building-and-testing-java-with-gradle">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Building and testing Java with Gradle</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to power CI in your Java project with Gradle.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">Java</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/building-and-testing-java-with-gradle</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/building-and-testing-java-with-ant">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Building and testing Java with Ant</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to power CI in your Java project with Ant.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">Java</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/building-and-testing-java-with-ant</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-lg-4 mb-4">
|
|
||||||
<a class="Box d-block hover-grow no-underline text-gray-dark" href="/actions/guides/publishing-nodejs-packages">
|
|
||||||
<div class="p-4">
|
|
||||||
<h4>Publishing Node.js packages</h4>
|
|
||||||
<p class="mt-2 mb-4">Use GitHub Actions to push your Node.js package to GitHub Packages or npm.</p>
|
|
||||||
<div class="d-flex">
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">JavaScript/TypeScript</span>
|
|
||||||
<span class="IssueLabel text-white bg-blue mr-2">CI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="border-top p-4 text-gray d-flex flex-items-center">
|
|
||||||
{% octicon "workflow" class="flex-shrink-0" %}
|
|
||||||
<span class="ml-2">/guides/publishing-nodejs-packages</span>
|
|
||||||
</footer>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="/actions/guides" class="btn btn-outline mt-4">Show all guides {% octicon "arrow-right" %}</a>
|
<div class="d-flex flex-wrap gutter">
|
||||||
|
{% render 'code-example-card' for actionsCodeExamples as example %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="js-code-example-show-more btn btn-outline float-right">Show more {% octicon "arrow-right" %}</button>
|
||||||
|
|
||||||
|
<div class="js-code-example-no-results d-none py-4 text-center text-gray font-mktg">
|
||||||
|
<div class="mb-3">{% octicon "search" width="24" %}</div>
|
||||||
|
<h3 class="text-normal">Sorry, there is no result for <strong class="js-code-example-filter-value"></strong></h3>
|
||||||
|
<p class="my-3 f4">It looks like we don't have an example that fits your filter.<br>Try another filter or add your code example</p>
|
||||||
|
<a href="https://github.com/github/docs/blob/main/data/variables/action_code_examples.yml">Learn how to add a code example {% octicon "arrow-right" %}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ A job is a set of steps that execute on the same runner. By default, a workflow
|
|||||||
|
|
||||||
#### Steps
|
#### Steps
|
||||||
|
|
||||||
A step is an individual task that can run commands (known as _actions_). Each step in a job executes on the same runner, allowing the actions in that job to share data with each other.
|
A step is an individual task that can run commands in a job. A step can be either an _action_ or a shell command. Each step in a job executes on the same runner, allowing the actions in that job to share data with each other.
|
||||||
|
|
||||||
#### Actions
|
#### Actions
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ _Actions_ are standalone commands that are combined into _steps_ to create a _jo
|
|||||||
|
|
||||||
#### Runners
|
#### Runners
|
||||||
|
|
||||||
A runner is a server that has the {% data variables.product.prodname_actions %} runner application installed. You can use a runner hosted by {% data variables.product.prodname_dotcom %}, or you can host your own. A runner listens for available jobs, runs one job at a time, and reports the progress, logs, and results back to {% data variables.product.prodname_dotcom %}. For {% data variables.product.prodname_dotcom %}-hosted runners, each job in a workflow runs in a fresh virtual environment.
|
A runner is a server that has the [{% data variables.product.prodname_actions %} runner application](https://github.com/actions/runner) installed. You can use a runner hosted by {% data variables.product.prodname_dotcom %}, or you can host your own. A runner listens for available jobs, runs one job at a time, and reports the progress, logs, and results back to {% data variables.product.prodname_dotcom %}. For {% data variables.product.prodname_dotcom %}-hosted runners, each job in a workflow runs in a fresh virtual environment.
|
||||||
|
|
||||||
{% data variables.product.prodname_dotcom %}-hosted runners are based on Ubuntu Linux, Microsoft Windows, and macOS. For information on {% data variables.product.prodname_dotcom %}-hosted runners, see "[Virtual environments for {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/virtual-environments-for-github-hosted-runners)." If you need a different operating system or require a specific hardware configuration, you can host your own runners. For information on self-hosted runners, see "[Hosting your own runners](/actions/hosting-your-own-runners)."
|
{% data variables.product.prodname_dotcom %}-hosted runners are based on Ubuntu Linux, Microsoft Windows, and macOS. For information on {% data variables.product.prodname_dotcom %}-hosted runners, see "[Virtual environments for {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/virtual-environments-for-github-hosted-runners)." If you need a different operating system or require a specific hardware configuration, you can host your own runners. For information on self-hosted runners, see "[Hosting your own runners](/actions/hosting-your-own-runners)."
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
|||||||
|
|
||||||
#### Visualizing the workflow file
|
#### Visualizing the workflow file
|
||||||
|
|
||||||
In this diagram, you can see the workflow file you just created and how the {% data variables.product.prodname_actions %} components are organized in a hierarchy. Each step executes a single action. Steps 1 and 2 use prebuilt community actions. To find more prebuilt actions for your workflows, see "[Finding and customizing actions](/actions/learn-github-actions/finding-and-customizing-actions)."
|
In this diagram, you can see the workflow file you just created and how the {% data variables.product.prodname_actions %} components are organized in a hierarchy. Each step executes a single action or shell command. Steps 1 and 2 use prebuilt community actions. Steps 3 and 4 run shell commands directly on the runner. To find more prebuilt actions for your workflows, see "[Finding and customizing actions](/actions/learn-github-actions/finding-and-customizing-actions)."
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
For more information, see "[Caching dependencies to speed up workflows](/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows)."
|
For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
### Using databases and service containers
|
### Using databases and service containers
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ GitHub Actions
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
For more information, see "[Caching dependencies to speed up workflows](/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows)."
|
{% data variables.product.prodname_actions %} caching is only applicable to {% data variables.product.prodname_dotcom %}-hosted runners. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
{% data variables.product.prodname_actions %} does not have an equivalent of CircleCI’s Docker Layer Caching (or DLC).
|
{% data variables.product.prodname_actions %} does not have an equivalent of CircleCI’s Docker Layer Caching (or DLC).
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ jobs:
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
|
{% data variables.product.prodname_actions %} caching is only applicable to {% data variables.product.prodname_dotcom %}-hosted runners. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
### Artifacts
|
### Artifacts
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,12 @@ git:
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
#### Using environment variables in a matrix
|
||||||
|
|
||||||
|
Travis CI and {% data variables.product.prodname_actions %} can both add custom environment variables to a test matrix, which allows you to refer to the variable in a later step.
|
||||||
|
|
||||||
|
In {% data variables.product.prodname_actions %}, you can use the `include` key to add custom environment variables to a matrix. {% data reusables.github-actions.matrix-variable-example %}
|
||||||
|
|
||||||
### Key features in {% data variables.product.prodname_actions %}
|
### Key features in {% data variables.product.prodname_actions %}
|
||||||
|
|
||||||
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:
|
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:
|
||||||
@@ -317,7 +323,7 @@ cache: npm
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
|
{% data variables.product.prodname_actions %} caching is only applicable to {% data variables.product.prodname_dotcom %}-hosted runners. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||||
|
|
||||||
### Examples of common tasks
|
### Examples of common tasks
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ You can see whether a workflow run is in progress or complete from the workflow
|
|||||||
|
|
||||||
If the run is complete, you can see whether the result was a success, failure, canceled, or neutral. If the run failed, you can view and search the build logs to diagnose the failure and re-run the workflow. You can also view billable job execution minutes, or download logs and build artifacts.
|
If the run is complete, you can see whether the result was a success, failure, canceled, or neutral. If the run failed, you can view and search the build logs to diagnose the failure and re-run the workflow. You can also view billable job execution minutes, or download logs and build artifacts.
|
||||||
|
|
||||||
{% data variables.product.prodname_actions %} use the Checks API to output statuses, results, and logs for a workflow. {% data variables.product.prodname_dotcom %} creates a new check suite for each workflow run. The check suite contains a check run for each job in the workflow, and each job includes steps. {% data variables.product.prodname_actions %} are run as a step in a workflow. For more information about the Checks API, see "[Checks](/v3/checks/)."
|
{% data variables.product.prodname_actions %} use the Checks API to output statuses, results, and logs for a workflow. {% data variables.product.prodname_dotcom %} creates a new check suite for each workflow run. The check suite contains a check run for each job in the workflow, and each job includes steps. {% data variables.product.prodname_actions %} are run as a step in a workflow. For more information about the Checks API, see "[Checks](/rest/reference/checks)."
|
||||||
|
|
||||||
{% data reusables.github-actions.invalid-workflow-files %}
|
{% data reusables.github-actions.invalid-workflow-files %}
|
||||||
|
|
||||||
|
|||||||
@@ -75,3 +75,69 @@ The super-linter workflow you just added runs any time code is pushed to your re
|
|||||||
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial
|
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial
|
||||||
- "[Guides](/actions/guides)" for specific uses cases and examples
|
- "[Guides](/actions/guides)" for specific uses cases and examples
|
||||||
- [github/super-linter](https://github.com/github/super-linter) for more details about configuring the Super-Linter action
|
- [github/super-linter](https://github.com/github/super-linter) for more details about configuring the Super-Linter action
|
||||||
|
|
||||||
|
<div id="quickstart-treatment" hidden>
|
||||||
|
|
||||||
|
### Introduction
|
||||||
|
|
||||||
|
Printing "Hello, World!" is a great way to explore the basic set up and syntax of a new programming language. In this guide, you'll use GitHub Actions to print "Hello, World!" within your {% data variables.product.prodname_dotcom %} repository's workflow logs. All you need to get started is a {% data variables.product.prodname_dotcom %} repository where you feel comfortable creating and running a sample {% data variables.product.prodname_actions %} workflow. Feel free to create a new repository for this Quickstart, you can use it to test this and future {% data variables.product.prodname_actions %} workflows.
|
||||||
|
|
||||||
|
### Creating your first workflow
|
||||||
|
|
||||||
|
1. From your repository on {% data variables.product.prodname_dotcom %}, create a new file in the `.github/workflows` directory named `hello-world.yml`. For more information, see "[Creating new files](/github/managing-files-in-a-repository/creating-new-files)."
|
||||||
|
2. Copy the following YAML contents into the `hello-world.yml` file.
|
||||||
|
{% raw %}
|
||||||
|
```yaml{:copy}
|
||||||
|
name: Say hello!
|
||||||
|
|
||||||
|
# GitHub Actions Workflows are automatically triggered by GitHub events
|
||||||
|
on:
|
||||||
|
# For this workflow, we're using the workflow_dispatch event which is triggered when the user clicks Run workflow in the GitHub Actions UI
|
||||||
|
workflow_dispatch:
|
||||||
|
# The workflow_dispatch event accepts optional inputs so you can customize the behavior of the workflow
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
description: 'Person to greet'
|
||||||
|
required: true
|
||||||
|
default: 'World'
|
||||||
|
# When the event is triggered, GitHub Actions will run the jobs indicated
|
||||||
|
jobs:
|
||||||
|
say_hello:
|
||||||
|
# Uses a ubuntu-latest runner to complete the requested steps
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
echo "Hello ${{ github.event.inputs.name }}!"
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
3. Scroll to the bottom of the page and select **Create a new branch for this commit and start a pull request**. Then, to create a pull request, click **Propose new file**.
|
||||||
|

|
||||||
|
4. Once the pull request has been merged, you'll be ready to move on to "Trigger your workflow".
|
||||||
|
|
||||||
|
### Trigger your workflow
|
||||||
|
|
||||||
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
|
{% data reusables.repositories.actions-tab %}
|
||||||
|
1. In the left sidebar, click the workfow you want to run.
|
||||||
|

|
||||||
|
1. On the right, click the **Run workflow** drop-down and click **Run workflow**. Optionally, you can enter a custom message into the "Person to greet" input before running the workflow.
|
||||||
|

|
||||||
|
1. The workflow run will appear at the top of the list of "Say hello!" workflow runs. Click "Say hello!" to see the result of the workflow run.
|
||||||
|

|
||||||
|
1. In the left sidebar, click the "say_hello" job.
|
||||||
|

|
||||||
|
1. In the workflow logs, expand the 'Run echo "Hello World!"' section.
|
||||||
|

|
||||||
|
|
||||||
|
### More starter workflows
|
||||||
|
|
||||||
|
{% data variables.product.prodname_dotcom %} provides preconfigured workflow templates that you can start from to automate or create a continuous integration workflows. You can browse the full list of workflow templates in the {% if currentVersion == "free-pro-team@latest" %}[actions/starter-workflows](https://github.com/actions/starter-workflows) repository{% else %} `actions/starter-workflows` repository on {% data variables.product.product_location %}{% endif %}.
|
||||||
|
|
||||||
|
### Next steps
|
||||||
|
|
||||||
|
The hello-world workflow you just added is a simple example of a manually triggered workflow. This is only the beginning of what you can do with {% data variables.product.prodname_actions %}. Your repository can contain multiple workflows that trigger different jobs based on different events. {% data variables.product.prodname_actions %} can help you automate nearly every aspect of your application development processes. Ready to get started? Here are some helpful resources for taking your next steps with {% data variables.product.prodname_actions %}:
|
||||||
|
|
||||||
|
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial
|
||||||
|
- "[Guides](/actions/guides)" for specific uses cases and examples
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|||||||