1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Merge branch 'main' into patch-1

This commit is contained in:
Laura Coursen
2020-12-02 14:33:48 -06:00
committed by GitHub
3936 changed files with 2393823 additions and 154837 deletions

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
dist/

28
.eslintrc.js Normal file
View 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
}
}
]
}

View File

@@ -22,6 +22,6 @@ Thanks again!
### Check off the following:
- [ ] 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 [Content style guide for GitHub Docs](https://github.com/github/docs/blob/main/contributing/content-style-guide.md).

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

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

View File

@@ -21,13 +21,16 @@ module.exports = [
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
'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',
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
'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'
]

View File

@@ -1,7 +1,7 @@
name: 60 Days Stale Check
on:
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:
stale:
@@ -17,4 +17,5 @@ jobs:
only-labels: 'engineering'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-pr-labels: 'never-stale'
exempt-issue-labels: 'never-stale'

View File

@@ -1,6 +1,6 @@
name: Auto label Pull Requests
on:
- pull_request
pull_request:
jobs:
triage:
@@ -9,4 +9,4 @@ jobs:
steps:
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: '${{ secrets.GITHUB_TOKEN }}'

View File

@@ -3,10 +3,10 @@ name: Auto Merge Dependency Updates
on:
pull_request:
paths:
- "package*.json"
- "Gemfile*"
- "Dockerfile"
- ".github/workflows/**"
- 'package*.json'
- 'Gemfile*'
- 'Dockerfile'
- '.github/workflows/**'
pull_request_review:
types:
- edited

View File

@@ -23,14 +23,14 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')
steps:
- name: automerge
uses: "pascalgn/automerge-action@c9bd182"
uses: 'pascalgn/automerge-action@c9bd182'
env:
GITHUB_TOKEN: "${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}"
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash"
MERGE_COMMIT_MESSAGE: "pull-request-title"
MERGE_METHOD: "merge"
MERGE_FORKS: "true"
MERGE_RETRIES: "50"
MERGE_RETRY_SLEEP: "10000" # ten seconds
UPDATE_LABELS: "automerge,autosquash"
UPDATE_METHOD: "merge"
GITHUB_TOKEN: '${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}'
MERGE_METHOD_LABELS: 'automerge=merge,autosquash=squash'
MERGE_COMMIT_MESSAGE: 'pull-request-title'
MERGE_METHOD: 'merge'
MERGE_FORKS: 'true'
MERGE_RETRIES: '50'
MERGE_RETRY_SLEEP: '10000' # ten seconds
UPDATE_LABELS: 'automerge,autosquash'
UPDATE_METHOD: 'merge'

View File

@@ -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"]'
build:
needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
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
- name: Install
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with:
args: npm ci
- name: Test
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Test
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with:
args: npm run browser-test

View File

@@ -1,8 +1,9 @@
name: Check all English links
on:
workflow_dispatch:
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:
check_all_english_links:
@@ -16,21 +17,32 @@ jobs:
- name: npm run build
run: npm run build
- name: Run script
run: script/check-external-links en > broken_links.md
- name: Check if any broken links
id: check
run: |
if [ "$(grep 'All links are good' broken_links.md)" ]; then
echo ::set-output name=continue::no
else
echo "::set-output name=continue::yes"
echo "::set-output name=title::$(grep 'found on help.github.com' broken_links.md)"
fi
- if: ${{ steps.check.outputs.continue == 'yes' }}
script/check-english-links.js > broken_links.md
- if: ${{ failure() }}
name: Get title for issue
id: check
run: echo "::set-output name=title::$(head -1 broken_links.md)"
- if: ${{ failure() }}
name: Close previous report
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
with:
query: 'label:"broken link report"'
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
- if: ${{ failure() }}
name: Create issue from file
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5
id: broken-link-report
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
with:
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 }}

View File

@@ -1,4 +1,4 @@
name: "CodeQL analysis"
name: CodeQL analysis
on:
push:

View File

@@ -3,7 +3,7 @@ name: Crowdin Sync
on:
workflow_dispatch:
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:
sync_with_crowdin:
@@ -47,5 +47,3 @@ jobs:
# See https://crowdin.com/settings#api-key to generate a token
# This token was created by logging into Crowdin with the octoglot user
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@@ -1,7 +1,12 @@
name: First responder docs-content
on:
pull_request:
types: [reopened, opened, ready_for_review, closed, unlabeled]
types:
- reopened
- opened
- ready_for_review
- closed
- unlabeled
jobs:
first-responder-triage-pr:
@@ -41,15 +46,15 @@ jobs:
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
if: steps.set-result.outputs.result == 'false'
with:
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
add-labels: "docs-content-fr"
repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
add-labels: 'docs-content-fr'
- name: Triage to FR PR project column
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
if: steps.set-result.outputs.result == 'false'
with:
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
project-url: "https://github.com/orgs/github/projects/1367"
column-name: "Docs-internal external contributor PRs"
project-url: 'https://github.com/orgs/github/projects/1367'
column-name: 'Docs-internal external contributor PRs'
first-responder-remove-pr:
name: Remove PR from FR project board
@@ -81,5 +86,5 @@ jobs:
if: github.event.action == 'closed'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with:
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
remove-labels: "docs-content-fr"
repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
remove-labels: 'docs-content-fr'

View File

@@ -21,7 +21,7 @@ jobs:
with:
cancel_others: 'false'
github_token: ${{ github.token }}
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml"]'
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml", ".eslint*"]'
lint:
runs-on: ubuntu-latest
@@ -53,7 +53,7 @@ jobs:
run: npm ci
- name: Run linter
run: npx standard
run: npx eslint .
- name: Check dependencies
run: npm run check-deps

View File

@@ -1,7 +1,8 @@
name: Merged notification
on:
pull_request_target:
types: ['closed']
types:
- 'closed'
jobs:
comment:

37
.github/workflows/openapi-decorate.yml vendored Normal file
View 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

View 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

View File

@@ -1,8 +1,8 @@
name: "Pa11y"
name: Pa11y
on:
workflow_dispatch:
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:
test:
runs-on: ubuntu-latest

View File

@@ -2,7 +2,7 @@ name: Ping staging apps
on:
schedule:
- cron: "*/20 * * * *" # every twenty minutes
- cron: '*/20 * * * *' # every twenty minutes
jobs:
ping_staging_apps:

View File

@@ -5,7 +5,7 @@ env:
on:
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:
remove_unused_assets:
@@ -39,7 +39,8 @@ jobs:
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
commit-message: Action ran script/remove-unused-assets.js
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:
"Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n
${{ steps.results.outputs.content }}
\n\nIf you have any questions, please contact @github/docs-engineering."
labels: unused assets

26
.github/workflows/repo-freeze-check.yml vendored Normal file
View 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

View File

@@ -2,7 +2,7 @@ name: Repo Freeze Reminders
on:
schedule:
- cron: "00 11 * * *" # once per day around 11:00am UTC
- cron: '00 11 * * *' # once per day around 11:00am UTC
env:
FREEZE: ${{ secrets.FREEZE }}
@@ -13,7 +13,6 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'github/docs-internal'
steps:
- name: Send Slack notification if repo is frozen
if: ${{ env.FREEZE == 'true' }}
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815

View File

@@ -8,7 +8,7 @@ name: Repo Sync
on:
schedule:
- cron: "*/15 * * * *" # every 15 minutes
- cron: '*/15 * * * *' # every 15 minutes
env:
FREEZE: ${{ secrets.FREEZE }}
@@ -18,7 +18,6 @@ jobs:
name: Check for deployment freezes
runs-on: ubuntu-latest
steps:
- name: Exit if repo is frozen
if: ${{ env.FREEZE == 'true' }}
run: |
@@ -30,7 +29,6 @@ jobs:
needs: check-freezer
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
@@ -51,7 +49,7 @@ jobs:
with:
source_branch: repo-sync
destination_branch: main
pr_title: "repo sync"
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 }}

View File

@@ -2,7 +2,9 @@ name: Send Issue to EPD backlog
on:
issues:
types: [labeled, reopened]
types:
- labeled
- reopened
jobs:
triage:

View File

@@ -2,7 +2,9 @@ name: Start new engineering PR workflow
on:
pull_request_target:
types: [opened, reopened]
types:
- opened
- reopened
jobs:
triage:

View 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

View File

@@ -4,7 +4,7 @@ name: Node.js Tests - Translations
on:
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:
lint:
@@ -38,7 +38,7 @@ jobs:
run: npm ci
- name: Run linter
run: npx standard
run: npx eslint .
- name: Check dependencies
run: npm run check-deps
@@ -78,4 +78,4 @@ jobs:
- name: Run tests
run: npx jest tests/${{ matrix.test-group }}/
env:
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_OPTIONS: '--max_old_space_size=4096'

View File

@@ -5,10 +5,7 @@ name: Node.js Tests - Windows
on:
workflow_dispatch:
schedule:
- cron: "50 19 * * *" # once a day at 19:50 UTC / 11:50 PST
env:
CI: true
- cron: '50 19 * * *' # once a day at 19:50 UTC / 11:50 PST
jobs:
test:
@@ -48,4 +45,4 @@ jobs:
- name: Run tests
run: npx jest tests/${{ matrix.test-group }}/
env:
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_OPTIONS: '--max_old_space_size=4096'

View File

@@ -31,28 +31,34 @@ jobs:
test:
needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
test-group: [content, meta, rendering, routing, unit, links-and-images]
test-group:
[content, meta, rendering, routing, unit, links-and-images, graphql]
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
- name: Setup node
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with:
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
run: |
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
with:
path: ${{ steps.npm-cache.outputs.dir }}
@@ -60,20 +66,23 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install dependencies
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
- name: Run tests
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Run tests
run: npx jest tests/${{ matrix.test-group }}/
env:
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_OPTIONS: '--max_old_space_size=4096'
- name: Send Slack notification if workflow fails
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
if: failure() && github.ref == 'early-access'
env:
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'

View File

@@ -2,7 +2,7 @@ name: Translations
on:
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:
FREEZE: ${{ secrets.FREEZE }}

View File

@@ -1,7 +1,8 @@
name: Triage new issue comments
on:
issue_comment:
types: [created]
types:
- created
jobs:
triage-issue-comments:
@@ -36,11 +37,11 @@ jobs:
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
if: (steps.is-internal-contributor.outputs.result == 'false')
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
add-labels: "triage"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: 'triage'
- name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with:
action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1"
column-name: "Triage"
project-url: 'https://github.com/github/docs/projects/1'
column-name: 'Triage'

View File

@@ -1,7 +1,9 @@
name: Triage new issues
on:
issues:
types: [reopened, opened]
types:
- reopened
- opened
jobs:
triage_issues:
@@ -12,11 +14,11 @@ jobs:
- name: Label new issues with 'triage'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
add-labels: "triage"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: 'triage'
- name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with:
action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1"
column-name: "Triage"
project-url: 'https://github.com/github/docs/projects/1'
column-name: 'Triage'

View File

@@ -1,7 +1,9 @@
name: Triage new pull requests
on:
pull_request:
types: [reopened, opened]
types:
- reopened
- opened
jobs:
triage_pulls:
@@ -12,11 +14,11 @@ jobs:
- name: Label new pull requests with 'triage'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
add-labels: "triage"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: 'triage'
- name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with:
action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1"
column-name: "Triage"
project-url: 'https://github.com/github/docs/projects/1'
column-name: 'Triage'

View File

@@ -1,7 +1,7 @@
name: Public Repo Stale Check
on:
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:
stale:
@@ -16,3 +16,5 @@ jobs:
days-before-stale: 7
days-before-close: 10
stale-pr-label: 'stale'
exempt-pr-labels: 'never-stale'
exempt-issue-labels: 'never-stale'

View File

@@ -10,7 +10,7 @@ env:
on:
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:
update_graphql_files:
@@ -37,22 +37,18 @@ jobs:
env:
# 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 }}
# technically the changelog should only be updated once per day, but we can safely
# run build-changelog-from-markdown.js in its current form once per hour; when we
# rewrite the changelog script, we may need to run it in a separate workflow on a
# once-per-day schedule; see details in https://github.com/github/docs-internal/issues/12722.
run: |
script/graphql/update-files.js
script/graphql/build-changelog-from-markdown.js
- name: Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
with:
# need to use a token with repo and workflow scopes for this step
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
commit-message: 'Action ran graphql scripts "update-files" and "build-changelog-from-markdown"'
commit-message: 'Action ran graphql script"update-files"'
title: GraphQL schema update
body: "Hello! Some GraphQL data in github/github was updated recently. This PR
body:
"Hello! Some GraphQL data in github/github was updated recently. This PR
syncs up the GraphQL data in this repo.\n\n
If CI passes, this PR will be auto-merged. :green_heart:\n\n
If CI does not pass or other problems arise, contact #docs-engineering on slack."

56
.github/workflows/yml-lint.yml vendored Normal file
View 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
View File

@@ -4,8 +4,6 @@
node_modules
npm-debug.log
coverage
# blc: broken link checker
blc_output.log
blc_output_internal.log
.linkinator
broken_links.md
dist

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
translations/

12
.prettierrc.json Normal file
View File

@@ -0,0 +1,12 @@
{
"overrides": [
{
"files":[
"**/*.{yml,yaml}"
],
"options": {
"singleQuote": true
}
}
]
}

View File

@@ -22,6 +22,7 @@ Examples of unacceptable behavior include:
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* 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
## Enforcement Responsibilities

View File

@@ -114,7 +114,8 @@ You can browse existing issues to find something that needs help!
### Labels
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 [`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.

View File

@@ -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.
In this article:
- [Contributing](#contributing)
- [READMEs](#readmes)
- [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).
#### And that's it!
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).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 545 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -32,8 +32,8 @@ You can build Docker container and JavaScript actions. Actions require a metadat
| Type | Operating system |
| ---- | ------------------- |
| Docker container | Linux |
| JavaScript | Linux, MacOS, Windows |
| Composite run steps | Linux, MacOS, Windows |
| JavaScript | Linux, macOS, Windows |
| Composite run steps | Linux, macOS, Windows |
#### Docker container actions

View File

@@ -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)."
### **`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.
### **`author`**
### `author`
**Optional** The name of the action's author.
### **`description`**
### `description`
**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.
@@ -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.
#### **`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 `_`.
#### **`inputs.<input_id>.description`**
#### `inputs.<input_id>.description`
**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.
#### **`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.
### **`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.
@@ -87,15 +87,15 @@ outputs:
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 `_`.
#### **`outputs.<output_id>.description`**
#### `outputs.<output_id>.description`
**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.
@@ -116,12 +116,12 @@ runs:
```
{% 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.
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.
@@ -133,15 +133,15 @@ runs:
main: 'main.js'
```
#### **`runs.using`**
#### `runs.using`
**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.
#### **`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).
@@ -155,7 +155,7 @@ runs:
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()`.
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'
```
#### **`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.
@@ -182,7 +182,7 @@ runs:
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()`.
@@ -193,19 +193,19 @@ For example, this `cleanup.js` will only run on Linux-based runners:
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.
#### **`runs.using`**
#### `runs.using`
**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.
##### **`runs.steps.run`**
##### `runs.steps.run`
**Required** The command you want to run. This can be inline or a script in your action repository:
```yaml
@@ -228,27 +228,27 @@ runs:
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).
##### **`runs.steps.name`**
##### `runs.steps.name`
**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)".
##### **`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.
##### **`runs.steps.working-directory`**
##### `runs.steps.working-directory`
**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.
@@ -268,11 +268,11 @@ runs:
image: 'docker://debian:stretch-slim'
```
#### **`runs.using`**
#### `runs.using`
**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).
@@ -290,21 +290,21 @@ runs:
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.
#### **`runs.env`**
#### `runs.env`
**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.
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).
@@ -318,7 +318,7 @@ runs:
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.
@@ -344,7 +344,7 @@ runs:
```
{% 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).
@@ -356,11 +356,11 @@ branding:
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`.
#### **`branding.icon`**
#### `branding.icon`
The name of the [Feather](https://feathericons.com/) icon to use.

View File

@@ -91,7 +91,7 @@ steps:
### 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 %}
```yaml

View File

@@ -91,7 +91,7 @@ steps:
### 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 %}
```yaml

View File

@@ -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.
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
@@ -227,7 +227,7 @@ always-auth=true
#### 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 %}
```yaml

View File

@@ -5,6 +5,8 @@ product: '{% data reusables.gated-features.actions %}'
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
authors:
- potatoqualitee
---
{% data reusables.actions.enterprise-beta %}
@@ -89,7 +91,7 @@ The table below describes the locations for various PowerShell modules in each {
{% 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:
@@ -117,7 +119,7 @@ jobs:
#### 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.

View File

@@ -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.
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 %}
```yaml
@@ -228,7 +228,7 @@ steps:
#### 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).

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

View File

@@ -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-powershell %}
{% 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-gradle %}
{% link_in_list /building-and-testing-java-with-ant %}

View File

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

View File

@@ -87,7 +87,7 @@ The following operating systems are supported for the self-hosted runner applica
- Windows Server 2016 64-bit
- Windows Server 2019 64-bit
#### MacOS
#### macOS
- macOS 10.13 (High Sierra) or later

View File

@@ -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.
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.org_settings %}
@@ -41,7 +41,19 @@ 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**.
![Add runner group](/assets/images/help/settings/actions-org-add-runner-group.png)
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 %}
![Add runner group options](/assets/images/help/settings/actions-org-add-runner-group-options.png)
1. Click **Save group** to create the group and apply the policy.
@@ -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.
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.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**.
![Add runner group](/assets/images/help/settings/actions-enterprise-account-add-runner-group.png)
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 %}
![Add runner group options](/assets/images/help/settings/actions-enterprise-account-add-runner-group-options.png)
1. Click **Save group** to create the group and apply the policy.

View File

@@ -7,27 +7,37 @@ introLinks:
reference: /actions/reference
featuredLinks:
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
gettingStarted:
- /actions/managing-workflow-runs
- /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:
- /actions/reference/workflow-syntax-for-github-actions
- /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:
- 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
date: '2020-10-16'
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:
- /articles/automating-your-workflow-with-github-actions/
- /articles/customizing-your-project-with-github-actions/
@@ -50,107 +60,26 @@ versions:
<!-- {% link_with_intro /reference %} -->
<!-- Code examples -->
{% assign actionsCodeExamples = site.data.variables.action_code_examples %}
{% if actionsCodeExamples %}
<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="pr-lg-3 mb-5 mt-3">
<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"/>
</div>
<div class="d-flex flex-wrap gutter">
<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-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>
{% render 'code-example-card' for actionsCodeExamples as example %}
</div>
<a href="/actions/guides" class="btn btn-outline mt-4">Show all guides {% octicon "arrow-right" %}</a>
<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>
{% endif %}

View File

@@ -42,7 +42,7 @@ A job is a set of steps that execute on the same runner. By default, a workflow
#### 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
@@ -50,7 +50,7 @@ _Actions_ are standalone commands that are combined into _steps_ to create a _jo
#### 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)."
@@ -197,7 +197,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
#### 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)."
![Workflow overview](/assets/images/help/images/overview-actions-event.png)

View File

@@ -106,7 +106,7 @@ jobs:
```
{% 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

View File

@@ -101,7 +101,7 @@ GitHub Actions
</tr>
</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 CircleCIs Docker Layer Caching (or DLC).

View File

@@ -346,7 +346,7 @@ jobs:
</tr>
</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

View File

@@ -164,6 +164,12 @@ git:
</tr>
</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 %}
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:
@@ -317,7 +323,7 @@ cache: npm
</tr>
</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

View File

@@ -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.
{% 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 %}

View File

@@ -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
- "[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
<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**.
![Commit workflow file](/assets/images/help/repository/commit-hello-world-file.png)
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.
![Select say hello job](/assets/images/help/repository/say-hello-job.png)
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.
![Trigger the manual workflow](/assets/images/help/repository/manual-workflow-trigger.png)
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.
![Workflow run result listing](/assets/images/help/repository/workflow-run-listing.png)
1. In the left sidebar, click the "say_hello" job.
![Workflow job listing](/assets/images/help/repository/workflow-job-listing.png)
1. In the workflow logs, expand the 'Run echo "Hello World!"' section.
![Workflow detail](/assets/images/help/repository/workflow-log-listing.png)
### 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>

View File

@@ -79,7 +79,7 @@ You can use the `GITHUB_TOKEN` to make authenticated API calls. This example wor
### Permissions for the `GITHUB_TOKEN`
For information about the API endpoints {% data variables.product.prodname_github_apps %} can access with each permission, see "[{% data variables.product.prodname_github_app %} Permissions](/v3/apps/permissions/)."
For information about the API endpoints {% data variables.product.prodname_github_apps %} can access with each permission, see "[{% data variables.product.prodname_github_app %} Permissions](/rest/reference/permissions-required-for-github-apps)."
| Permission | Access type | Access by forked repos |
|------------|-------------|--------------------------|

View File

@@ -75,7 +75,7 @@ In order to use property dereference syntax, the property name must:
- start with `a-Z` or `_`.
- be followed by `a-Z` `0-9` `-` or `_`.
#### **`github` context**
#### `github` context
The `github` context contains information about the workflow run and the event that triggered the run. You can read most of the `github` context data in environment variables. For more information about environment variables, see "[Using environment variables](/actions/automating-your-workflow-with-github-actions/using-environment-variables)."
@@ -103,7 +103,7 @@ The `github` context contains information about the workflow run and the event t
| `github.workflow` | `string` | The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository. |
| `github.workspace` | `string` | The default working directory for steps and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action. |
#### **`env` context**
#### `env` context
The `env` context contains environment variables that have been set in a workflow, job, or step. For more information about setting environment variables in your workflow, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env)."
@@ -117,7 +117,7 @@ You can only use the `env` context in the value of the `with` and `name` keys, o
| `env.<env name>` | `string` | The value of a specific environment variable. |
#### **`job` context**
#### `job` context
The `job` context contains information about the currently running job.
@@ -133,7 +133,7 @@ The `job` context contains information about the currently running job.
| `job.services.<service id>.ports` | `object` | The exposed ports of the service container. |
| `job.status` | `string` | The current status of the job. Possible values are `success`, `failure`, or `cancelled`. |
#### **`steps` context**
#### `steps` context
The `steps` context contains information about the steps in the current job that have already run.
@@ -145,7 +145,7 @@ The `steps` context contains information about the steps in the current job that
| `steps.<step id>.outcome` | `string` | The result of a completed step before [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
| `steps.<step id>.outputs.<output name>` | `string` | The value of a specific output. |
#### **`runner` context**
#### `runner` context
The `runner` context contains information about the runner that is executing the current job.
@@ -155,7 +155,7 @@ The `runner` context contains information about the runner that is executing the
| `runner.temp` | `string` | The path of the temporary directory for the runner. This directory is guaranteed to be empty at the start of each job, even on self-hosted runners. |
| `runner.tool_cache` | `string` | The path of the directory containing some of the preinstalled tools for {% data variables.product.prodname_dotcom %}-hosted runners. For more information, see "[Specifications for {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/specifications-for-github-hosted-runners/#supported-software)". |
#### **`needs` context**
#### `needs` context
The `needs` context contains outputs from all jobs that are defined as a dependency of the current job. For more information on defining job dependencies, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds)."

Some files were not shown because too many files have changed in this diff Show More