Merge branch 'main' into patch-1
|
@ -0,0 +1,18 @@
|
|||
// Codespaces environment for docs.github.com
|
||||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
|
||||
{
|
||||
"name": "docs.github.com",
|
||||
"service": "container-doc",
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"cSpell.language": ",en"
|
||||
},
|
||||
// Install pre-requisites, and start to serve docs.github.com locally
|
||||
"postCreateCommand": "npm install && npm start",
|
||||
"forwardPorts": [4000],
|
||||
// Visual Studio Code extensions which help authoring for docs.github.com.
|
||||
"extensions": [
|
||||
"yzhang.markdown-all-in-one",
|
||||
"streetsidesoftware.code-spell-checker"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
|
@ -0,0 +1 @@
|
|||
dist/
|
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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).
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
// can be added it this list.
|
||||
|
||||
module.exports = [
|
||||
'actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16', //actions/cache@v2.1.2
|
||||
'actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675', //actions/checkout@v2.3.3
|
||||
'actions/cache@0781355a23dac32fd3bac414512f4b903437991a', //actions/cache@v2.1.3
|
||||
'actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f', //actions/checkout@v2.3.4
|
||||
'actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9', //actions/script@v3.0.0
|
||||
'actions/labeler@5f867a63be70efff62b767459b009290364495eb', //actions/labeler@v2.2.0
|
||||
'actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d', //actions/setup-node@v1.4.4
|
||||
'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526', //actions/setup-ruby@v1.1.2
|
||||
'actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8', //actions/stale@v3.0.12
|
||||
'actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4', //actions/stale@v3.0.13
|
||||
'crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688',
|
||||
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911',
|
||||
'docker://chinthakagodawita/autoupdate-action:v1',
|
||||
|
@ -22,7 +22,7 @@ module.exports = [
|
|||
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
|
||||
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
|
||||
'pascalgn/automerge-action@c9bd182',
|
||||
'peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5',
|
||||
'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
|
||||
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
|
||||
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
|
||||
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8
|
||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
|
||||
|
@ -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'
|
||||
|
|
|
@ -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 }}'
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
name: Auto Merge Dependency Updates
|
||||
|
||||
on:
|
||||
- pull_request
|
||||
- pull_request_review
|
||||
pull_request:
|
||||
paths:
|
||||
- 'package*.json'
|
||||
- 'Gemfile*'
|
||||
- 'Dockerfile'
|
||||
- '.github/workflows/**'
|
||||
pull_request_review:
|
||||
types:
|
||||
- edited
|
||||
- submitted
|
||||
|
||||
jobs:
|
||||
run:
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
# Even if if doesn't do anything
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Install
|
||||
|
|
|
@ -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:
|
||||
|
@ -10,25 +11,20 @@ jobs:
|
|||
if: github.repository == 'github/docs-internal'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- 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
|
||||
run: script/check-english-links.js > broken_links.md
|
||||
- if: ${{ failure() }}
|
||||
name: Get title for issue
|
||||
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' }}
|
||||
run: echo "::set-output name=title::$(head -1 broken_links.md)"
|
||||
- if: ${{ failure() }}
|
||||
name: Create issue from file
|
||||
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5
|
||||
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 }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name: "CodeQL analysis"
|
||||
name: CodeQL analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -11,7 +11,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
|
||||
|
|
|
@ -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:
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Sync
|
||||
uses: crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688
|
||||
|
@ -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 }}
|
||||
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
- name: cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
name: Lint JS
|
||||
|
||||
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: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml", ".eslint*"]'
|
||||
|
||||
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 eslint .
|
||||
|
||||
- name: Check dependencies
|
||||
run: npm run check-deps
|
|
@ -1,10 +1,12 @@
|
|||
name: Merged notification
|
||||
on:
|
||||
pull_request_target:
|
||||
types: ['closed']
|
||||
types:
|
||||
- 'closed'
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
if: github.event.repository.private == false && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
|
||||
if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
|
@ -16,7 +16,7 @@ jobs:
|
|||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
|
|
@ -2,7 +2,7 @@ name: Ping staging apps
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "*/20 * * * *" # every twenty minutes
|
||||
- cron: '*/20 * * * *' # every twenty minutes
|
||||
|
||||
jobs:
|
||||
ping_staging_apps:
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
|||
env:
|
||||
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: npm run build
|
||||
|
|
|
@ -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:
|
||||
|
@ -18,7 +18,7 @@ jobs:
|
|||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: Run scripts
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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,9 +29,8 @@ jobs:
|
|||
needs: check-freezer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Sync repo to branch
|
||||
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
|
||||
|
@ -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 }}
|
||||
|
|
|
@ -2,7 +2,9 @@ name: Send Issue to EPD backlog
|
|||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled, reopened]
|
||||
types:
|
||||
- labeled
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
|
|
|
@ -2,7 +2,9 @@ name: Start new engineering PR workflow
|
|||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened]
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
|
|
|
@ -13,12 +13,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
- name: cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
|
|
@ -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:
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
with:
|
||||
ref: translations # check out the 'translations' branch
|
||||
|
||||
|
@ -27,7 +27,7 @@ jobs:
|
|||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
@ -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
|
||||
|
@ -52,7 +52,7 @@ jobs:
|
|||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
|||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
@ -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'
|
||||
|
|
|
@ -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:
|
||||
|
@ -19,7 +16,7 @@ jobs:
|
|||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
|
@ -32,7 +29,7 @@ jobs:
|
|||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
@ -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'
|
||||
|
|
|
@ -28,51 +28,11 @@ jobs:
|
|||
cancel_others: 'false'
|
||||
github_token: ${{ github.token }}
|
||||
paths: '[".github/workflows/test.yml",".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
|
||||
lint:
|
||||
needs: see_if_should_skip
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 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@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- 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)"
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Run linter
|
||||
run: npx standard
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Check dependencies
|
||||
run: npm run check-deps
|
||||
test:
|
||||
needs: see_if_should_skip
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
@ -82,7 +42,7 @@ jobs:
|
|||
# Even if if doesn't do anything
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Setup node
|
||||
|
@ -98,7 +58,7 @@ jobs:
|
|||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
@ -117,11 +77,11 @@ 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'
|
||||
|
||||
- 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'
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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:
|
||||
|
@ -9,10 +9,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8
|
||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
|
||||
days-before-stale: 7
|
||||
days-before-close: 10
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'never-stale'
|
||||
exempt-issue-labels: 'never-stale'
|
||||
|
|
|
@ -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:
|
||||
|
@ -22,7 +22,7 @@ jobs:
|
|||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: Set up Ruby
|
||||
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
|
||||
with:
|
||||
|
@ -52,7 +52,8 @@ jobs:
|
|||
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
commit-message: 'Action ran graphql scripts "update-files" and "build-changelog-from-markdown"'
|
||||
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."
|
||||
|
|
|
@ -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}"
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
translations/
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"overrides": [
|
||||
{
|
||||
"files":[
|
||||
"**/*.{yml,yaml}"
|
||||
],
|
||||
"options": {
|
||||
"singleQuote": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -27,8 +27,13 @@ Fork using GitHub Desktop:
|
|||
- Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
|
||||
|
||||
Fork using the command line:
|
||||
|
||||
- [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
|
||||
|
||||
Fork with [GitHub Codespaces](https://github.com/features/codespaces):
|
||||
|
||||
- [Fork, edit, and preview](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace) using [GitHub Codespaces](https://github.com/features/codespaces) without having to install and run the project locally.
|
||||
|
||||
### Make your update:
|
||||
Make your changes to the file(s) you'd like to update. Here are some tips and tricks for [using the docs codebase](#working-in-the-githubdocs-repository).
|
||||
- Are you making changes to the application code? You'll need **Node.js v14** to run the site locally. See [contributing/development.md](contributing/development.md).
|
||||
|
@ -89,7 +94,7 @@ A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and
|
|||
When we merge those changes, they should be deployed to the live site within 24 hours. :earth_africa: To learn more about opening a pull request in this repo, see [Opening a pull request](#opening-a-pull-request) below.
|
||||
|
||||
### :question: Support
|
||||
We are a small team working hard to keep up with the documentation demands of a continously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
|
||||
We are a small team working hard to keep up with the documentation demands of a continuously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
|
||||
|
||||
If you're having trouble with your GitHub account, contact [Support](https://support.github.com/contact).
|
||||
|
||||
|
@ -109,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.
|
||||
|
||||
|
@ -129,7 +135,7 @@ Here's some information that might be helpful while working on a Docs PR:
|
|||
|
||||
- [Variables](/data/variables/README.md) - We use variables the same way we use reusables. Variables are for short strings of reusable text.
|
||||
|
||||
- [Liquid](/contribution/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
|
||||
- [Liquid](/contributing/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
|
||||
|
||||
- [Scripts](/script/README.md) - The scripts directory is the home for all of the scripts you can run locally.
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
|
После Ширина: | Высота: | Размер: 4.9 KiB |
Двоичные данные
assets/images/help/codespaces/choose-branch-vscode.png
До Ширина: | Высота: | Размер: 33 KiB После Ширина: | Высота: | Размер: 122 KiB |
Двоичные данные
assets/images/help/codespaces/choose-repository-vscode.png
До Ширина: | Высота: | Размер: 90 KiB После Ширина: | Высота: | Размер: 123 KiB |
После Ширина: | Высота: | Размер: 211 KiB |
До Ширина: | Высота: | Размер: 40 KiB После Ширина: | Высота: | Размер: 295 KiB |
Двоичные данные
assets/images/help/codespaces/codespaces-header-vscode.png
До Ширина: | Высота: | Размер: 11 KiB После Ширина: | Высота: | Размер: 383 KiB |
Двоичные данные
assets/images/help/codespaces/create-codespace-vscode.png
До Ширина: | Высота: | Размер: 228 KiB После Ширина: | Высота: | Размер: 165 KiB |
Двоичные данные
assets/images/help/codespaces/delete-codespace-vscode.png
До Ширина: | Высота: | Размер: 42 KiB После Ширина: | Высота: | Размер: 545 KiB |
До Ширина: | Высота: | Размер: 26 KiB После Ширина: | Высота: | Размер: 406 KiB |
После Ширина: | Высота: | Размер: 73 KiB |
После Ширина: | Высота: | Размер: 96 KiB |
После Ширина: | Высота: | Размер: 35 KiB |
После Ширина: | Высота: | Размер: 50 KiB |
После Ширина: | Высота: | Размер: 38 KiB |
Двоичные данные
assets/images/help/notifications-v2/watch-repository-options-custom2.png
Normal file
После Ширина: | Высота: | Размер: 19 KiB |
После Ширина: | Высота: | Размер: 17 KiB |
До Ширина: | Высота: | Размер: 6.4 KiB После Ширина: | Высота: | Размер: 9.2 KiB |
После Ширина: | Высота: | Размер: 7.8 KiB |
До Ширина: | Высота: | Размер: 82 KiB После Ширина: | Высота: | Размер: 68 KiB |
До Ширина: | Высота: | Размер: 68 KiB После Ширина: | Высота: | Размер: 49 KiB |
До Ширина: | Высота: | Размер: 68 KiB После Ширина: | Высота: | Размер: 76 KiB |
Двоичные данные
assets/images/help/package-registry/enable-improved-container-support-for-orgs.png
Normal file
После Ширина: | Высота: | Размер: 43 KiB |
До Ширина: | Высота: | Размер: 24 KiB После Ширина: | Высота: | Размер: 43 KiB |
После Ширина: | Высота: | Размер: 630 KiB |
После Ширина: | Высота: | Размер: 146 KiB |
После Ширина: | Высота: | Размер: 104 KiB |
До Ширина: | Высота: | Размер: 5.3 KiB После Ширина: | Высота: | Размер: 9.9 KiB |
После Ширина: | Высота: | Размер: 7.9 KiB |
После Ширина: | Высота: | Размер: 188 KiB |
До Ширина: | Высота: | Размер: 70 KiB После Ширина: | Высота: | Размер: 46 KiB |
До Ширина: | Высота: | Размер: 39 KiB После Ширина: | Высота: | Размер: 21 KiB |
До Ширина: | Высота: | Размер: 82 KiB После Ширина: | Высота: | Размер: 39 KiB |
До Ширина: | Высота: | Размер: 79 KiB После Ширина: | Высота: | Размер: 63 KiB |
После Ширина: | Высота: | Размер: 21 KiB |
После Ширина: | Высота: | Размер: 67 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
До Ширина: | Высота: | Размер: 8.7 KiB После Ширина: | Высота: | Размер: 34 KiB |
До Ширина: | Высота: | Размер: 24 KiB После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 58 KiB |
После Ширина: | Высота: | Размер: 56 KiB |
После Ширина: | Высота: | Размер: 9.4 KiB |
Двоичные данные
assets/images/help/settings/user-account-temporary-interaction-limits-options.png
Normal file
После Ширина: | Высота: | Размер: 61 KiB |
|
@ -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 %}
|
||||
|
@ -21,7 +23,7 @@ This guide shows you how to use PowerShell for CI. It describes how to use Peste
|
|||
You should be familiar with YAML and the syntax for {% data variables.product.prodname_actions %}. For more information, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)."
|
||||
|
||||
We recommend that you have a basic understanding of PowerShell and Pester. For more information, see:
|
||||
- [Getting started with PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started)
|
||||
- [Getting started with PowerShell](https://docs.microsoft.com/powershell/scripting/learn/ps101/01-getting-started)
|
||||
- [Pester](https://pester.dev)
|
||||
|
||||
{% data reusables.actions.enterprise-setup-prereq %}
|
||||
|
@ -85,7 +87,7 @@ The table below describes the locations for various PowerShell modules in each {
|
|||
|
||||
{% note %}
|
||||
|
||||
**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce signficant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`.
|
||||
**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce significant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
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, you can use the `actions/cache` Action directly. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
- name: Bundle install
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
bundle install --jobs 4 --retry 3
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
If you're using a matrix build, you will want to include the matrix variables in your cache key. For example, if you have a matrix strategy for different ruby versions (`matrix.ruby-version`) and different operating systems (`matrix.os`), your workflow steps might look like this:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-
|
||||
- name: Bundle install
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
bundle install --jobs 4 --retry 3
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Matrix testing your code
|
||||
|
||||
The following example matrix tests all stable releases and head versions of MRI, JRuby and TruffleRuby on Ubuntu and macOS.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Matrix Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu, macos]
|
||||
ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
- run: bundle install
|
||||
- run: bundle exec rake
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Linting your code
|
||||
|
||||
The following example installs `rubocop` and uses it to lint all files. For more information, see [Rubocop](https://github.com/rubocop-hq/rubocop). You can [configure Rubocop](https://docs.rubocop.org/rubocop/configuration.html) to decide on the specific linting rules.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Linting
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- run: bundle install
|
||||
- name: Rubocop
|
||||
run: rubocop
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Publishing Gems
|
||||
|
||||
You can configure your workflow to publish your Ruby package to any package registry you'd like when your CI tests pass.
|
||||
|
||||
You can store any access tokens or credentials needed to publish your package using repository secrets. The following example creates and publishes a package to `GitHub Package Registry` and `RubyGems`.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
|
||||
name: Ruby Gem
|
||||
|
||||
on:
|
||||
# Manually publish
|
||||
workflow_dispatch:
|
||||
# Alternatively, publish whenever changes are merged to the default branch.
|
||||
push:
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build + Publish
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Ruby 2.6
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- run: bundle install
|
||||
|
||||
- name: Publish to GPR
|
||||
run: |
|
||||
mkdir -p $HOME/.gem
|
||||
touch $HOME/.gem/credentials
|
||||
chmod 0600 $HOME/.gem/credentials
|
||||
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
||||
gem build *.gemspec
|
||||
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
||||
env:
|
||||
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
|
||||
- name: Publish to RubyGems
|
||||
run: |
|
||||
mkdir -p $HOME/.gem
|
||||
touch $HOME/.gem/credentials
|
||||
chmod 0600 $HOME/.gem/credentials
|
||||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
||||
gem build *.gemspec
|
||||
gem push *.gem
|
||||
env:
|
||||
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
||||
```
|
||||
{% endraw %}
|
||||
|
|
@ -31,6 +31,7 @@ You can use {% data variables.product.prodname_actions %} to create custom conti
|
|||
{% link_in_list /building-and-testing-nodejs %}
|
||||
{% link_in_list /building-and-testing-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 %}
|
||||
|
|
|
@ -8,6 +8,8 @@ redirect_from:
|
|||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '>=2.22'
|
||||
authors:
|
||||
- GitHub
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
|
|
|
@ -11,6 +11,8 @@ redirect_from:
|
|||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '>=2.22'
|
||||
authors:
|
||||
- GitHub
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
|
|
|
@ -171,12 +171,12 @@ Jobs that are dependent on a previous job's artifacts must wait for the dependen
|
|||
|
||||
Job 1 performs these steps:
|
||||
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
|
||||
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the name `homework`. The action places the file in a directory named `homework`.
|
||||
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework`.
|
||||
|
||||
Job 2 uses the result in the previous job:
|
||||
- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
|
||||
- Reads the value in the `homework/math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt`.
|
||||
- Uploads the `math-homework.txt` file. This upload overwrites the previous upload because both of the uploads share the same name.
|
||||
- Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents.
|
||||
- Uploads the `math-homework.txt` file. This upload overwrites the previously uploaded artifact because they share the same name.
|
||||
|
||||
Job 3 displays the result uploaded in the previous job:
|
||||
- Downloads the `homework` artifact.
|
||||
|
|
|
@ -111,6 +111,7 @@ You must ensure that the machine has the appropriate network access to communica
|
|||
github.com
|
||||
api.github.com
|
||||
*.actions.githubusercontent.com
|
||||
codeload.github.com
|
||||
```
|
||||
|
||||
If you use an IP address allow list for your {% data variables.product.prodname_dotcom %} organization or enterprise account, you must add your self-hosted runner's IP address to the allow list. For more information, see "[Managing allowed IP addresses for your organization](/github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list)" or "[Enforcing security settings in your enterprise account](/github/setting-up-and-managing-your-enterprise/enforcing-security-settings-in-your-enterprise-account#using-github-actions-with-an-ip-allow-list)".
|
||||
|
|
|
@ -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,17 @@ 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 +62,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 +71,17 @@ 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.
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -90,7 +90,7 @@ For more information, see "[Using release management for actions](/actions/creat
|
|||
|
||||
### Using inputs and outputs with an action
|
||||
|
||||
An action often accepts or requires inputs and generates outputs that you can use. For example, an action might require you to specify a path to a file, the name of a label, or other data it will uses as part of the action processing.
|
||||
An action often accepts or requires inputs and generates outputs that you can use. For example, an action might require you to specify a path to a file, the name of a label, or other data it will use as part of the action processing.
|
||||
|
||||
To see the inputs and outputs of an action, check the `action.yml` or `action.yaml` in the root directory of the repository.
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ versions:
|
|||
{% link_with_intro /managing-complex-workflows %}
|
||||
{% link_with_intro /sharing-workflows-with-your-organization %}
|
||||
{% link_with_intro /security-hardening-for-github-actions %}
|
||||
{% link_with_intro /migrating-from-azure-pipelines-to-github-actions %}
|
||||
{% link_with_intro /migrating-from-circleci-to-github-actions %}
|
||||
{% link_with_intro /migrating-from-gitlab-cicd-to-github-actions %}
|
||||
{% link_with_intro /migrating-from-azure-pipelines-to-github-actions %}
|
||||
{% link_with_intro /migrating-from-jenkins-to-github-actions %}
|
||||
{% link_with_intro /migrating-from-travis-ci-to-github-actions %}
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ Jobs and steps in Azure Pipelines are very similar to jobs and steps in {% data
|
|||
|
||||
### Migrating script steps
|
||||
|
||||
You can run a script or a shell command as a step in a workflow. In Azure Pipelines, script steps can be specified using the `script` key, or with the `bash`, `powershell`, or `pwsh` keys. Scripts can also be specified as an input to the [Bash task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/bash?view=azure-devops) or the [PowerShell task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops).
|
||||
You can run a script or a shell command as a step in a workflow. In Azure Pipelines, script steps can be specified using the `script` key, or with the `bash`, `powershell`, or `pwsh` keys. Scripts can also be specified as an input to the [Bash task](https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash?view=azure-devops) or the [PowerShell task](https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops).
|
||||
|
||||
In {% data variables.product.prodname_actions %}, all scripts are specified using the `run` key. To select a particular shell, you can specify the `shell` key when providing the script. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun)."
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ GitLab CI/CD
|
|||
deploy_prod:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Deply to production server"
|
||||
- echo "Deploy to production server"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
```
|
||||
|
@ -194,7 +194,7 @@ jobs:
|
|||
if: contains( github.ref, 'master')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Deply to production server"
|
||||
- run: echo "Deploy to production server"
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
|
|
|
@ -0,0 +1,410 @@
|
|||
---
|
||||
title: Migrating from Travis CI to GitHub Actions
|
||||
intro: '{% data variables.product.prodname_actions %} and Travis CI share multiple similarities, which helps make it relatively straightforward to migrate to {% data variables.product.prodname_actions %}.'
|
||||
redirect_from:
|
||||
- /actions/migrating-to-github-actions/migrating-from-travis-ci-to-github-actions
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '>=2.22'
|
||||
---
|
||||
|
||||
### Introduction
|
||||
|
||||
This guide helps you migrate from Travis CI to {% data variables.product.prodname_actions %}. It compares their concepts and syntax, describes the similarities, and demonstrates their different approaches to common tasks.
|
||||
|
||||
### Before you start
|
||||
|
||||
Before starting your migration to {% data variables.product.prodname_actions %}, it would be useful to become familiar with how it works:
|
||||
|
||||
- For a quick example that demonstrates a {% data variables.product.prodname_actions %} job, see "[Quickstart for {% data variables.product.prodname_actions %}](/actions/quickstart)."
|
||||
- To learn the essential {% data variables.product.prodname_actions %} concepts, see "[Introduction to GitHub Actions](/actions/learn-github-actions/introduction-to-github-actions)."
|
||||
|
||||
### Comparing job execution
|
||||
|
||||
To give you control over when CI tasks are executed, a {% data variables.product.prodname_actions %} _workflow_ uses _jobs_ that run in parallel by default. Each job contains _steps_ that are executed in a sequence that you define. If you need to run setup and cleanup actions for a job, you can define steps in each job to perform these.
|
||||
|
||||
### Key similarities
|
||||
|
||||
{% data variables.product.prodname_actions %} and Travis CI share certain similarities, and understanding these ahead of time can help smooth the migration process.
|
||||
|
||||
#### Using YAML syntax
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both use YAML to create jobs and workflows, and these files are stored in the code's repository. For more information on how {% data variables.product.prodname_actions %} uses YAML, see ["Creating a workflow file](/actions/learn-github-actions/introduction-to-github-actions#create-an-example-workflow)."
|
||||
|
||||
#### Custom environment variables
|
||||
|
||||
Travis CI lets you set environment variables and share them between stages. Similarly, {% data variables.product.prodname_actions %} lets you define environment variables for a step, job, or workflow. For more information, see ["Environment variables](/actions/reference/environment-variables)."
|
||||
|
||||
#### Default environment variables
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both include default environment variables that you can use in your YAML files. For {% data variables.product.prodname_actions %}, you can see these listed in "[Default environment variables](/actions/reference/environment-variables#default-environment-variables)."
|
||||
|
||||
#### Parallel job processing
|
||||
|
||||
Travis CI can use `stages` to run jobs in parallel. Similarly, {% data variables.product.prodname_actions %} runs `jobs` in parallel. For more information, see "[Creating dependent jobs](/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs)."
|
||||
|
||||
#### Status badges
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both support status badges, which let you indicate whether a build is passing or failing.
|
||||
For more information, see ["Adding a workflow status badge to your repository](/actions/managing-workflow-runs/adding-a-workflow-status-badge)."
|
||||
|
||||
#### Using a build matrix
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both support a build matrix, allowing you to perform testing using combinations of operating systems and software packages. For more information, see "[Using a build matrix](/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix)."
|
||||
|
||||
Below is an example comparing the syntax for each system:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
matrix:
|
||||
include:
|
||||
- rvm: 2.5
|
||||
- rvm: 2.6.3
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: [2.5, 2.6.3]
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### Targeting specific branches
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both allow you to target your CI to a specific branch. For more information, see "[Workflow syntax for GitHub Actions](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags)."
|
||||
|
||||
Below is an example of the syntax for each system:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- 'mona/octocat'
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'mona/octocat'
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### Checking out submodules
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} both allow you to control whether submodules are included in the repository clone.
|
||||
|
||||
Below is an example of the syntax for each system:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
git:
|
||||
submodules: false
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: false
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Key features in {% data variables.product.prodname_actions %}
|
||||
|
||||
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:
|
||||
|
||||
#### Storing secrets
|
||||
|
||||
{% data variables.product.prodname_actions %} allows you to store secrets and reference them in your jobs. {% data variables.product.prodname_actions %} also includes policies that allow you to limit access to secrets at the repository and organization level. For more information, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."
|
||||
|
||||
#### Sharing files between jobs and workflows
|
||||
|
||||
{% data variables.product.prodname_actions %} includes integrated support for artifact storage, allowing you to share files between jobs in a workflow. You can also save the resulting files and share them with other workflows. For more information, see "[Sharing data between jobs](/actions/learn-github-actions/essential-features-of-github-actions#sharing-data-between-jobs)."
|
||||
|
||||
#### Hosting your own runners
|
||||
|
||||
If your jobs require specific hardware or software, {% data variables.product.prodname_actions %} allows you to host your own runners and send your jobs to them for processing. {% data variables.product.prodname_actions %} also lets you use policies to control how these runners are accessed, granting access at the organization or repository level. For more information, see ["Hosting your own runners](/actions/hosting-your-own-runners)."
|
||||
|
||||
#### Concurrent jobs and execution time
|
||||
|
||||
The concurrent jobs and workflow execution times in {% data variables.product.prodname_actions %} can vary depending on your {% data variables.product.company_short %} plan. For more information, see "[Usage limits, billing, and administration](/actions/reference/usage-limits-billing-and-administration)."
|
||||
|
||||
#### Using different languages in {% data variables.product.prodname_actions %}
|
||||
|
||||
When working with different languages in {% data variables.product.prodname_actions %}, you can create a step in your job to set up your language dependencies. For more information about working with a particular language, see the specific guide:
|
||||
- [Building and testing Node.js](/actions/guides/building-and-testing-nodejs)
|
||||
- [Building and testing PowerShell](/actions/guides/building-and-testing-powershell)
|
||||
- [Building and testing Python](/actions/guides/building-and-testing-python)
|
||||
- [Building and testing Java with Maven](/actions/guides/building-and-testing-java-with-maven)
|
||||
- [Building and testing Java with Gradle](/actions/guides/building-and-testing-java-with-gradle)
|
||||
- [Building and testing Java with Ant](/actions/guides/building-and-testing-java-with-ant)
|
||||
|
||||
### Executing scripts
|
||||
|
||||
{% data variables.product.prodname_actions %} can use `run` steps to run scripts or shell commands. To use a particular shell, you can specify the `shell` type when providing the path to the script. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun)."
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Run build script
|
||||
run: ./.github/scripts/build.sh
|
||||
shell: bash
|
||||
```
|
||||
|
||||
### Error handling in {% data variables.product.prodname_actions %}
|
||||
|
||||
When migrating to {% data variables.product.prodname_actions %}, there are different approaches to error handling that you might need to be aware of.
|
||||
|
||||
#### Script error handling
|
||||
|
||||
{% data variables.product.prodname_actions %} stops a job immediately if one of the steps returns an error code. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference)."
|
||||
|
||||
#### Job error handling
|
||||
|
||||
{% data variables.product.prodname_actions %} uses `if` conditionals to execute jobs or steps in certain situations. For example, you can run a step when another step results in a `failure()`. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#example-using-status-check-functions)." You can also use [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error) to prevent a workflow run from stopping when a job fails.
|
||||
|
||||
### Migrating syntax for conditionals and expressions
|
||||
|
||||
To run jobs under conditional expressions, Travis CI and {% data variables.product.prodname_actions %} share a similar `if` condition syntax. {% data variables.product.prodname_actions %} lets you use the `if` conditional to prevent a job or step from running unless a condition is met. For more information, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)."
|
||||
|
||||
This example demonstrates how an `if` conditional can control whether a step is executed:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
conditional:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "This step runs with str equals 'ABC' and num equals 123"
|
||||
if: env.str == 'ABC' && env.num == 123
|
||||
```
|
||||
|
||||
### Migrating phases to steps
|
||||
|
||||
Where Travis CI uses _phases_ to run _steps_, {% data variables.product.prodname_actions %} has _steps_ which execute _actions_. You can find prebuilt actions in the [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace?type=actions), or you can create your own actions. For more information, see "[Building actions](/actions/building-actions)."
|
||||
|
||||
Below is an example of the syntax for each system:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
language: python
|
||||
python:
|
||||
- "3.7"
|
||||
|
||||
script:
|
||||
- python script.py
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
run_python:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.7'
|
||||
architecture: 'x64'
|
||||
- run: python script.py
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Caching dependencies
|
||||
|
||||
Travis CI and {% data variables.product.prodname_actions %} let you manually cache dependencies for later reuse. This example demonstrates the cache syntax for each system.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
GitHub Actions
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
language: node_js
|
||||
cache: npm
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
```yaml
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: v1-npm-deps-
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
|
||||
|
||||
### Examples of common tasks
|
||||
|
||||
This section compares how {% data variables.product.prodname_actions %} and Travis CI perform common tasks.
|
||||
|
||||
#### Configuring environment variables
|
||||
|
||||
You can create custom environment variables in a {% data variables.product.prodname_actions %} job. For example:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %} Workflow
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
```yaml
|
||||
env:
|
||||
- MAVEN_PATH="/usr/local/maven"
|
||||
```
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
maven-build:
|
||||
env:
|
||||
MAVEN_PATH: '/usr/local/maven'
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### Building with Node.js
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Travis CI
|
||||
</th>
|
||||
<th>
|
||||
{% data variables.product.prodname_actions %} Workflow
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{% raw %}
|
||||
```yaml
|
||||
install:
|
||||
- npm install
|
||||
script:
|
||||
- npm run build
|
||||
- npm test
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td>
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Node.js CI
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### Next steps
|
||||
|
||||
To continue learning about the main features of {% data variables.product.prodname_actions %}, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)."
|
|
@ -26,7 +26,7 @@ Secrets use [Libsodium sealed boxes](https://libsodium.gitbook.io/doc/public-key
|
|||
To help prevent accidental disclosure, {% data variables.product.product_name %} uses a mechanism that attempts to redact any secrets that appear in run logs. This redaction looks for exact matches of any configured secrets, as well as common encodings of the values, such as Base64. However, because there are multiple ways a secret value can be transformed, this redaction is not guaranteed. As a result, there are certain proactive steps and good practices you should follow to help ensure secrets are redacted, and to limit other risks associated with secrets:
|
||||
|
||||
- **Never use structured data as a secret**
|
||||
- Unstructured data can cause secret redaction within logs to fail, because redaction largely relies on finding an exact match for the specific secret value. For example, do not use a blob of JSON, XML, or YAML (or similar) to encapsulate a secret value, as this significantly reduces the probability the secrets will be properly redacted. Instead, create individual secrets for each sensitive value.
|
||||
- Structured data can cause secret redaction within logs to fail, because redaction largely relies on finding an exact match for the specific secret value. For example, do not use a blob of JSON, XML, or YAML (or similar) to encapsulate a secret value, as this significantly reduces the probability the secrets will be properly redacted. Instead, create individual secrets for each sensitive value.
|
||||
- **Register all secrets used within workflows**
|
||||
- If a secret is used to generate another sensitive value within a workflow, that generated value should be formally [registered as a secret](https://github.com/actions/toolkit/tree/main/packages/core#setting-a-secret), so that it will be redacted if it ever appears in the logs. For example, if using a private key to generate a signed JWT to access a web API, be sure to register that JWT as a secret or else it won’t be redacted if it ever enters the log output.
|
||||
- Registering secrets applies to any sort of transformation/encoding as well. If your secret is transformed in some way (such as Base64 or URL-encoded), be sure to register the new value as a secret too.
|
||||
|
@ -98,7 +98,7 @@ You should also consider the environment of the self-hosted runner machines:
|
|||
|
||||
### Auditing {% data variables.product.prodname_actions %} events
|
||||
|
||||
You can use the audit log to monitor administrative tasks in an organization. The audit log records the type of action, when it was run, and which user account perfomed the action.
|
||||
You can use the audit log to monitor administrative tasks in an organization. The audit log records the type of action, when it was run, and which user account performed the action.
|
||||
|
||||
For example, you can use the audit log to track the `action:org.update_actions_secret` event, which tracks changes to organization secrets:
|
||||
![Audit log entries](/assets/images/help/repository/audit-log-entries.png)
|
||||
|
|