Merge branch 'main' into actions-sha
142
.github/actions-scripts/msft-create-translation-batch-pr.js
vendored
Executable file
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import fs from 'fs'
|
||||
import github from '@actions/github'
|
||||
|
||||
const OPTIONS = Object.fromEntries(
|
||||
['BASE', 'BODY_FILE', 'GITHUB_TOKEN', 'HEAD', 'LANGUAGE', 'TITLE', 'GITHUB_REPOSITORY'].map(
|
||||
(envVarName) => {
|
||||
const envVarValue = process.env[envVarName]
|
||||
if (!envVarValue) {
|
||||
throw new Error(`You must supply a ${envVarName} environment variable`)
|
||||
}
|
||||
return [envVarName, envVarValue]
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
if (!process.env.GITHUB_REPOSITORY) {
|
||||
throw new Error('GITHUB_REPOSITORY environment variable not set')
|
||||
}
|
||||
|
||||
const RETRY_STATUSES = [
|
||||
422, // Retry the operation if the PR already exists
|
||||
502, // Retry the operation if the API responds with a `502 Bad Gateway` error.
|
||||
]
|
||||
const RETRY_ATTEMPTS = 3
|
||||
const {
|
||||
// One of the default environment variables provided by Actions.
|
||||
GITHUB_REPOSITORY,
|
||||
|
||||
// These are passed in from the step in the workflow file.
|
||||
TITLE,
|
||||
BASE,
|
||||
HEAD,
|
||||
LANGUAGE,
|
||||
BODY_FILE,
|
||||
GITHUB_TOKEN,
|
||||
} = OPTIONS
|
||||
const [OWNER, REPO] = GITHUB_REPOSITORY.split('/')
|
||||
|
||||
const octokit = github.getOctokit(GITHUB_TOKEN)
|
||||
|
||||
/**
|
||||
* @param {object} config Configuration options for finding the PR.
|
||||
* @returns {Promise<number | undefined>} The PR number.
|
||||
*/
|
||||
async function findPullRequestNumber(config) {
|
||||
// Get a list of PRs and see if one already exists.
|
||||
const { data: listOfPullRequests } = await octokit.rest.pulls.list({
|
||||
owner: config.owner,
|
||||
repo: config.repo,
|
||||
head: `${config.owner}:${config.head}`,
|
||||
})
|
||||
|
||||
return listOfPullRequests[0]?.number
|
||||
}
|
||||
|
||||
/**
|
||||
* When this file was first created, we only introduced support for creating a pull request for some translation batch.
|
||||
* However, some of our first workflow runs failed during the pull request creation due to a timeout error.
|
||||
* There have been cases where, despite the timeout error, the pull request gets created _anyway_.
|
||||
* To accommodate this reality, we created this function to look for an existing pull request before a new one is created.
|
||||
* Although the "find" check is redundant in the first "cycle", it's designed this way to recursively call the function again via its retry mechanism should that be necessary.
|
||||
*
|
||||
* @param {object} config Configuration options for creating the pull request.
|
||||
* @returns {Promise<number>} The PR number.
|
||||
*/
|
||||
async function findOrCreatePullRequest(config) {
|
||||
const found = await findPullRequestNumber(config)
|
||||
|
||||
if (found) {
|
||||
return found
|
||||
}
|
||||
|
||||
try {
|
||||
const { data: pullRequest } = await octokit.rest.pulls.create({
|
||||
owner: config.owner,
|
||||
repo: config.repo,
|
||||
base: config.base,
|
||||
head: config.head,
|
||||
title: config.title,
|
||||
body: config.body,
|
||||
draft: false,
|
||||
})
|
||||
|
||||
return pullRequest.number
|
||||
} catch (error) {
|
||||
if (!error.response || !config.retryCount) {
|
||||
throw error
|
||||
}
|
||||
|
||||
if (!config.retryStatuses.includes(error.response.status)) {
|
||||
throw error
|
||||
}
|
||||
|
||||
console.error(`Error creating pull request: ${error.message}`)
|
||||
console.warn(`Retrying in 5 seconds...`)
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000))
|
||||
|
||||
config.retryCount -= 1
|
||||
|
||||
return findOrCreatePullRequest(config)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} config Configuration options for labeling the PR
|
||||
* @returns {Promise<undefined>}
|
||||
*/
|
||||
// async function labelPullRequest(config) {
|
||||
// await octokit.rest.issues.update({
|
||||
// owner: config.owner,
|
||||
// repo: config.repo,
|
||||
// issue_number: config.issue_number,
|
||||
// labels: config.labels,
|
||||
// })
|
||||
// }
|
||||
|
||||
async function main() {
|
||||
const options = {
|
||||
title: TITLE,
|
||||
base: BASE,
|
||||
head: HEAD,
|
||||
body: fs.readFileSync(BODY_FILE, 'utf8'),
|
||||
labels: ['translation-batch', `translation-batch-${LANGUAGE}`],
|
||||
owner: OWNER,
|
||||
repo: REPO,
|
||||
retryStatuses: RETRY_STATUSES,
|
||||
retryCount: RETRY_ATTEMPTS,
|
||||
}
|
||||
|
||||
options.issue_number = await findOrCreatePullRequest(options)
|
||||
const pr = `${GITHUB_REPOSITORY}#${options.issue_number}`
|
||||
console.log(`Created PR ${pr}`)
|
||||
|
||||
// metadata parameters aren't currently available in `github.rest.pulls.create`,
|
||||
// but they are in `github.rest.issues.update`.
|
||||
// await labelPullRequest(options)
|
||||
// console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`)
|
||||
}
|
||||
|
||||
main()
|
||||
2
.github/workflows/autoupdate-branch.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -210,6 +210,3 @@ jobs:
|
||||
dockerRegistryUrl="${{ secrets.NONPROD_REGISTRY_SERVER }}"
|
||||
dockerRegistryUsername="${{ env.NONPROD_REGISTRY_USERNAME }}"
|
||||
dockerRegistryPassword="${{ secrets.NONPROD_REGISTRY_PASSWORD }}"
|
||||
# this shows warnings in the github actions console, because the flag is passed through a validation run,
|
||||
# but it *is* functional during the actual execution
|
||||
additionalArguments: --no-wait
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Clone docs-early-access
|
||||
|
||||
31
.github/workflows/azure-staging-build-deploy.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Azure Staging - Build and Deploy
|
||||
|
||||
# **What it does**: Builds and deploys a branch/PR to staging
|
||||
# **Why we have it**: To enable us to deploy a branch/PR to staging whenever necessary
|
||||
# **Who does it impact**: All contributors.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
PR_NUMBER:
|
||||
description: 'PR Number'
|
||||
type: string
|
||||
required: true
|
||||
COMMIT_REF:
|
||||
description: 'The commit SHA to build'
|
||||
type: string
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
jobs:
|
||||
azure-staging-build-and-deploy:
|
||||
if: ${{ github.repository == 'github/docs-internal' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 'No-op'
|
||||
run: |
|
||||
echo "No-op"
|
||||
2
.github/workflows/browser-test.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
34
.github/workflows/check-all-english-links.yml
vendored
@@ -30,17 +30,34 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
- name: npm ci
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Cache nextjs build
|
||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
||||
with:
|
||||
path: .next/cache
|
||||
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}
|
||||
- name: npm run build
|
||||
|
||||
- name: Build server
|
||||
run: npm run build
|
||||
|
||||
- name: Start server in the background
|
||||
env:
|
||||
NODE_ENV: production
|
||||
PORT: 4000
|
||||
DISABLE_OVERLOAD_PROTECTION: true
|
||||
DISABLE_RENDER_CACHING: true
|
||||
# We don't want or need the changelog entries in this context.
|
||||
CHANGELOG_DISABLED: true
|
||||
run: |
|
||||
node server.mjs &
|
||||
sleep 5
|
||||
curl --retry-connrefused --retry 3 -I http://localhost:4000/
|
||||
|
||||
- name: Run script
|
||||
run: |
|
||||
script/check-english-links.js > broken_links.md
|
||||
@@ -53,6 +70,16 @@ jobs:
|
||||
#
|
||||
# https://docs.github.com/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions
|
||||
|
||||
- if: ${{ failure() }}
|
||||
name: Debug broken_links.md
|
||||
run: |
|
||||
ls -lh broken_links.md
|
||||
wc -l broken_links.md
|
||||
- uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: broken_links
|
||||
path: ./broken_links.md
|
||||
- if: ${{ failure() }}
|
||||
name: Get title for issue
|
||||
id: check
|
||||
@@ -63,7 +90,6 @@ jobs:
|
||||
uses: peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e
|
||||
with:
|
||||
token: ${{ env.GITHUB_TOKEN }}
|
||||
|
||||
title: ${{ steps.check.outputs.title }}
|
||||
content-filepath: ./broken_links.md
|
||||
repository: ${{ env.REPORT_REPOSITORY }}
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
@@ -57,6 +57,8 @@ jobs:
|
||||
env:
|
||||
NODE_ENV: production
|
||||
PORT: 4000
|
||||
DISABLE_OVERLOAD_PROTECTION: true
|
||||
DISABLE_RENDER_CACHING: true
|
||||
run: |
|
||||
|
||||
node server.mjs &
|
||||
|
||||
2
.github/workflows/code-lint.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install temporary dependencies
|
||||
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
- name: 'Setup node'
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
|
||||
- run: npm ci
|
||||
|
||||
|
||||
2
.github/workflows/crowdin-cleanup.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/docs-review-collect.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/enterprise-dates.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/link-check-all.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install
|
||||
|
||||
204
.github/workflows/msft-create-translation-batch-pr.yml
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
name: Create translation Batch Pull Request
|
||||
|
||||
# **What it does**:
|
||||
# - Creates one pull request per language after running a series of automated checks,
|
||||
# removing translations that are broken in any known way
|
||||
# **Why we have it**:
|
||||
# - To deploy translations
|
||||
# **Who does it impact**: It automates what would otherwise be manual work,
|
||||
# helping docs engineering focus on higher value work
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# TODO: bring schedule back in
|
||||
# schedule:
|
||||
# - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
create-translation-batch:
|
||||
name: Create translation batch
|
||||
if: github.repository == 'github/docs-internal'
|
||||
runs-on: ubuntu-latest
|
||||
# A sync's average run time is ~3.2 hours.
|
||||
# This sets a maximum execution time of 300 minutes (5 hours) to prevent the workflow from running longer than necessary.
|
||||
timeout-minutes: 300
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
include:
|
||||
# TODO: replace language_repos with actual repos once created
|
||||
# - language: pt
|
||||
# crowdin_language: pt-BR
|
||||
# language_dir: translations/pt-BR
|
||||
# language_repo: github/docs-translations-pt-br
|
||||
|
||||
- language: es
|
||||
crowdin_language: es-ES
|
||||
language_dir: translations/es-ES
|
||||
language_repo: github/docs-localization-test-es-es
|
||||
|
||||
# - language: cn
|
||||
# crowdin_language: zh-CN
|
||||
# language_dir: translations/zh-CN
|
||||
# language_repo: github/docs-translations-zh-cn
|
||||
|
||||
# - language: ja
|
||||
# crowdin_language: ja
|
||||
# language_dir: translations/ja-JP
|
||||
# language_repo: github/docs-translations-ja-jp
|
||||
|
||||
# TODO: replace the branch name
|
||||
steps:
|
||||
- name: Set branch name
|
||||
id: set-branch
|
||||
run: |
|
||||
echo "::set-output name=BRANCH_NAME::msft-translation-batch-${{ matrix.language }}-$(date +%Y-%m-%d__%H-%M)"
|
||||
|
||||
- run: git config --global user.name "docubot"
|
||||
- run: git config --global user.email "67483024+docubot@users.noreply.github.com"
|
||||
|
||||
- name: Checkout the docs-internal repo
|
||||
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
|
||||
- name: Create a branch for the current language
|
||||
run: git checkout -b ${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
|
||||
- name: Remove unwanted git hooks
|
||||
run: rm .git/hooks/post-checkout
|
||||
|
||||
- name: Remove all language translations
|
||||
run: |
|
||||
git rm -rf --quiet ${{ matrix.language_dir }}/content
|
||||
git rm -rf --quiet ${{ matrix.language_dir }}/data
|
||||
|
||||
- name: Checkout the language-specific repo
|
||||
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
|
||||
with:
|
||||
repository: ${{ matrix.language_repo }}
|
||||
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
|
||||
path: ${{ matrix.language_dir }}
|
||||
|
||||
- name: Remove .git from the language-specific repo
|
||||
run: rm -rf ${{ matrix.language_dir }}/.git
|
||||
|
||||
# TODO: Rename this step
|
||||
- name: Commit crowdin sync
|
||||
run: |
|
||||
git add ${{ matrix.language_dir }}
|
||||
git commit -m "Add crowdin translations" || echo "Nothing to commit"
|
||||
|
||||
- name: 'Setup node'
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.15.x
|
||||
|
||||
- run: npm ci
|
||||
|
||||
# step 6 in docs-engineering/crowdin.md
|
||||
- name: Homogenize frontmatter
|
||||
run: |
|
||||
node script/i18n/homogenize-frontmatter.js
|
||||
git add ${{ matrix.language_dir }} && git commit -m "Run script/i18n/homogenize-frontmatter.js" || echo "Nothing to commit"
|
||||
|
||||
# step 7 in docs-engineering/crowdin.md
|
||||
- name: Fix translation errors
|
||||
run: |
|
||||
node script/i18n/fix-translation-errors.js
|
||||
git add ${{ matrix.language_dir }} && git commit -m "Run script/i18n/fix-translation-errors.js" || echo "Nothing to commit"
|
||||
|
||||
# step 8a in docs-engineering/crowdin.md
|
||||
- name: Check parsing
|
||||
run: |
|
||||
node script/i18n/lint-translation-files.js --check parsing | tee -a /tmp/batch.log | cat
|
||||
git add ${{ matrix.language_dir }} && git commit -m "Run script/i18n/lint-translation-files.js --check parsing" || echo "Nothing to commit"
|
||||
|
||||
# step 8b in docs-engineering/crowdin.md
|
||||
- name: Check rendering
|
||||
run: |
|
||||
node script/i18n/lint-translation-files.js --check rendering | tee -a /tmp/batch.log | cat
|
||||
git add ${{ matrix.language_dir }} && git commit -m "Run script/i18n/lint-translation-files.js --check rendering" || echo "Nothing to commit"
|
||||
|
||||
- name: Reset files with broken liquid tags
|
||||
run: |
|
||||
node script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language }} | tee -a /tmp/batch.log | cat
|
||||
git add ${{ matrix.language_dir }} && git commit -m "run script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language }}" || echo "Nothing to commit"
|
||||
|
||||
# step 5 in docs-engineering/crowdin.md using script from docs-internal#22709
|
||||
- name: Reset known broken files
|
||||
run: |
|
||||
node script/i18n/reset-known-broken-translation-files.js | tee -a /tmp/batch.log | cat
|
||||
git add ${{ matrix.language_dir }} && git commit -m "run script/i18n/reset-known-broken-translation-files.js" || echo "Nothing to commit"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
|
||||
- name: Check in CSV report
|
||||
run: |
|
||||
mkdir -p translations/log
|
||||
csvFile=translations/log/${{ matrix.language }}-resets.csv
|
||||
script/i18n/report-reset-files.js --report-type=csv --language=${{ matrix.language }} --log-file=/tmp/batch.log > $csvFile
|
||||
git add -f $csvFile && git commit -m "Check in ${{ matrix.language }} CSV report" || echo "Nothing to commit"
|
||||
|
||||
- name: Write the reported files that were reset to /tmp/pr-body.txt
|
||||
run: script/i18n/report-reset-files.js --report-type=pull-request-body --language=${{ matrix.language }} --log-file=/tmp/batch.log > /tmp/pr-body.txt
|
||||
|
||||
- name: Push filtered translations
|
||||
run: git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
|
||||
# TODO: bring this step back
|
||||
# - name: Close existing stale batches
|
||||
# uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
|
||||
# with:
|
||||
# token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
# query: 'type:pr label:translation-batch-${{ matrix.language }}'
|
||||
|
||||
# TODO: bring labels back into the PR script
|
||||
- name: Create translation batch pull request
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
TITLE: '[DO NOT MERGE] Msft: New translation batch for ${{ matrix.language }}'
|
||||
BASE: 'main'
|
||||
HEAD: ${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
LANGUAGE: ${{ matrix.language }}
|
||||
BODY_FILE: '/tmp/pr-body.txt'
|
||||
run: .github/actions-scripts/msft-create-translation-batch-pr.js
|
||||
|
||||
# TODO: bring back these steps
|
||||
# - name: Approve PR
|
||||
# if: github.ref_name == 'main'
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
# run: gh pr review --approve || echo "Nothing to approve"
|
||||
|
||||
# - name: Set auto-merge
|
||||
# if: github.ref_name == 'main'
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
# run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
|
||||
|
||||
# # When the maximum execution time is reached for this job, Actions cancels the workflow run.
|
||||
# # This emits a notification for the first responder to triage.
|
||||
# - name: Send Slack notification if workflow is cancelled
|
||||
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
|
||||
# if: cancelled()
|
||||
# with:
|
||||
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
# color: failure
|
||||
# text: 'The new translation batch for ${{ matrix.language }} was cancelled.'
|
||||
|
||||
# # Emit a notification for the first responder to triage if the workflow failed.
|
||||
# - name: Send Slack notification if workflow failed
|
||||
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
|
||||
# if: failure()
|
||||
# with:
|
||||
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
# color: failure
|
||||
# text: 'The new translation batch for ${{ matrix.language }} failed.'
|
||||
2
.github/workflows/open-enterprise-issue.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/openapi-decorate.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/openapi-schema-check.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/orphaned-assets-check.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install
|
||||
|
||||
2
.github/workflows/os-ready-for-review.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/pa11y.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/package-lock-lint.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
|
||||
- name: Run check
|
||||
run: |
|
||||
|
||||
2
.github/workflows/ready-for-doc-review.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/remove-unused-assets.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
|
||||
2
.github/workflows/repo-sync.yml
vendored
@@ -104,7 +104,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
2
.github/workflows/sync-search-indices.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/sync-search-pr.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/test.yml
vendored
@@ -125,7 +125,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/update-graphql-files.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
||||
with:
|
||||
node-version: 16.14.x
|
||||
node-version: 16.15.x
|
||||
cache: npm
|
||||
- name: Install Node.js dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# --------------------------------------------------------------------------------
|
||||
# BASE IMAGE
|
||||
# --------------------------------------------------------------------------------
|
||||
FROM node:16.13.2-alpine@sha256:f21f35732964a96306a84a8c4b5a829f6d3a0c5163237ff4b6b8b34f8d70064b as base
|
||||
FROM node:16.15.0-alpine@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 as base
|
||||
|
||||
# This directory is owned by the node user
|
||||
ARG APP_HOME=/home/node/app
|
||||
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
BIN
assets/images/help/writing/inline-math-markdown-rendering.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 24 KiB |
@@ -22,12 +22,6 @@ const ClientSideHighlightJS = dynamic(() => import('./ClientSideHighlightJS'), {
|
||||
|
||||
// Mapping of a "normal" article to it's interactive counterpart
|
||||
const interactiveAlternatives: Record<string, { href: string }> = {
|
||||
'/actions/automating-builds-and-tests/building-and-testing-nodejs': {
|
||||
href: '/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python?langId=nodejs',
|
||||
},
|
||||
'/actions/automating-builds-and-tests/building-and-testing-python': {
|
||||
href: '/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python?langId=python',
|
||||
},
|
||||
'/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces':
|
||||
{
|
||||
href: '/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces?langId=nodejs',
|
||||
|
||||
@@ -107,6 +107,7 @@ export type MainContextT = {
|
||||
fullTitle?: string
|
||||
introPlainText?: string
|
||||
hidden: boolean
|
||||
noEarlyAccessBanner: boolean
|
||||
permalinks?: Array<{
|
||||
languageCode: string
|
||||
relativePath: string
|
||||
@@ -171,6 +172,7 @@ export const getMainContext = (req: any, res: any): MainContextT => {
|
||||
])
|
||||
),
|
||||
hidden: req.context.page.hidden || false,
|
||||
noEarlyAccessBanner: req.context.page.noEarlyAccessBanner || false,
|
||||
},
|
||||
enterpriseServerReleases: pick(req.context.enterpriseServerReleases, [
|
||||
'isOldestReleaseDeprecated',
|
||||
|
||||
@@ -2,16 +2,12 @@ import React, { createContext, useContext, useState } from 'react'
|
||||
import { CodeLanguage, PlaygroundArticleT } from 'components/playground/types'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
import actionsJsArticle from 'components/playground/content/actions/guides/building-and-testing-nodejs-or-python/nodejs'
|
||||
import actionsPyArticle from 'components/playground/content/actions/guides/building-and-testing-nodejs-or-python/python'
|
||||
import codespacesJsArticle from 'components/playground/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces/nodejs'
|
||||
import codespacesPyArticle from 'components/playground/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces/python'
|
||||
import codespacesNetArticle from 'components/playground/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces/dotnet'
|
||||
import codespacesJavaArticle from 'components/playground/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces/java'
|
||||
|
||||
const articles = [
|
||||
actionsJsArticle,
|
||||
actionsPyArticle,
|
||||
codespacesJsArticle,
|
||||
codespacesPyArticle,
|
||||
codespacesJavaArticle,
|
||||
|
||||
@@ -21,7 +21,7 @@ type Notif = {
|
||||
export const HeaderNotifications = () => {
|
||||
const router = useRouter()
|
||||
const { currentVersion } = useVersion()
|
||||
const { relativePath, allVersions, data, userLanguage, currentPathWithoutLanguage } =
|
||||
const { relativePath, allVersions, data, userLanguage, currentPathWithoutLanguage, page } =
|
||||
useMainContext()
|
||||
const { languages } = useLanguages()
|
||||
const { t } = useTranslation('header')
|
||||
@@ -69,7 +69,7 @@ export const HeaderNotifications = () => {
|
||||
...translationNotices,
|
||||
...releaseNotices,
|
||||
// ONEOFF EARLY ACCESS NOTICE
|
||||
(relativePath || '').includes('early-access/')
|
||||
(relativePath || '').includes('early-access/') && !page.noEarlyAccessBanner
|
||||
? {
|
||||
type: NotificationType.EARLY_ACCESS,
|
||||
content: t('notices.early_access'),
|
||||
|
||||
@@ -1,536 +0,0 @@
|
||||
import dedent from 'ts-dedent'
|
||||
import { PlaygroundArticleT } from 'components/playground/types'
|
||||
|
||||
const article: PlaygroundArticleT = {
|
||||
title: 'Building and testing Node.js',
|
||||
shortTitle: 'Build & test Node.js',
|
||||
topics: ['CI', 'Node', 'JavaScript'],
|
||||
type: 'tutorial',
|
||||
slug: '/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python',
|
||||
originalArticle: '/actions/automating-builds-and-tests/building-and-testing-nodejs',
|
||||
codeLanguageId: 'nodejs',
|
||||
intro: dedent`
|
||||
This guide shows you how to create a continuous integration (CI) workflow that builds and tests Node.js code. If your CI tests pass, you may want to deploy your code or publish a package.
|
||||
`,
|
||||
prerequisites: dedent`
|
||||
We recommend that you have a basic understanding of Node.js, YAML, workflow configuration options, and how to create a workflow file. For more information, see:
|
||||
|
||||
- [Learn GitHub Actions](/actions/learn-github-actions)
|
||||
- [Getting started with Node.js](https://nodejs.org/en/docs/guides/getting-started-guide/)
|
||||
`,
|
||||
contentBlocks: [
|
||||
{
|
||||
codeBlock: {
|
||||
id: '0',
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Using the Node.js starter workflow',
|
||||
content: dedent`
|
||||
GitHub provides a Node.js starter workflow that will work for most Node.js projects. This guide includes npm and Yarn examples that you can use to customize the starter workflow. For more information, see the [Node.js starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/node.js.yml).
|
||||
|
||||
To get started quickly, add the starter workflow to the \`.github/workflows\` directory of your repository. The example workflow assumes that the default branch for your repository is \`main\`.
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '0',
|
||||
highlight: 12,
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Running on a different operating system',
|
||||
content: dedent`
|
||||
The starter workflow configures jobs to run on Linux, using the GitHub-hosted \`ubuntu-latest\` runners. You can change the \`runs-on\` key to run your jobs on a different operating system. For example, you can use the GitHub-hosted Windows runners.
|
||||
|
||||
\`\`\`yaml
|
||||
runs-on: windows-latest
|
||||
\`\`\`
|
||||
|
||||
Or, you can run on the GitHub-hosted macOS runners.
|
||||
|
||||
\`\`\`yaml
|
||||
runs-on: macos-latest
|
||||
\`\`\`
|
||||
|
||||
You can also run jobs in Docker containers, or you can provide a self-hosted runner that runs on your own infrastructure. For more information, see "[Workflow syntax for GitHub Actions](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '0',
|
||||
highlight: [14, 23],
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Specifying the Node.js version',
|
||||
content: dedent`
|
||||
The easiest way to specify a Node.js version is by using the \`setup-node\` action provided by GitHub. For more information see, [\`setup-node\`](https://github.com/actions/setup-node/).
|
||||
|
||||
The \`setup-node\` action takes a Node.js version as an input and configures that version on the runner. The \`setup-node\` action finds a specific version of Node.js from the tools cache on each runner and adds the necessary binaries to \`PATH\`, which persists for the rest of the job. Using the \`setup-node\` action is the recommended way of using Node.js with GitHub Actions because it ensures consistent behavior across different runners and different versions of Node.js. If you are using a self-hosted runner, you must install Node.js and add it to \`PATH\`.
|
||||
|
||||
The starter workflow includes a matrix strategy that builds and tests your code with four Node.js versions: 10.x, 12.x, 14.x, and 15.x. The 'x' is a wildcard character that matches the latest minor and patch release available for a version. Each version of Node.js specified in the \`node-version\` array creates a job that runs the same steps.
|
||||
|
||||
Each job can access the value defined in the matrix \`node-version\` array using the \`matrix\` context. The \`setup-node\` action uses the context as the \`node-version\` input. The \`setup-node\` action configures each job with a different Node.js version before building and testing code. For more information about matrix strategies and contexts, see "[Workflow syntax for GitHub Actions](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)" and "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '1',
|
||||
highlight: 16,
|
||||
},
|
||||
type: 'sub-section',
|
||||
content: dedent`
|
||||
Alternatively, you can build and test with exact Node.js versions.
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '2',
|
||||
highlight: 19,
|
||||
},
|
||||
type: 'sub-section',
|
||||
content: dedent`
|
||||
Or, you can build and test using a single version of Node.js too.
|
||||
|
||||
If you don't specify a Node.js version, GitHub uses the environment's default Node.js version.
|
||||
For more information, see "[Specifications for GitHub-hosted runners](/actions/reference/specifications-for-github-hosted-runners/#supported-software)".
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '3',
|
||||
highlight: 21,
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Installing dependencies',
|
||||
content: dedent`
|
||||
GitHub-hosted runners have npm and Yarn dependency managers installed. You can use npm and Yarn to install dependencies in your workflow before building and testing your code. The Windows and Linux GitHub-hosted runners also have Grunt, Gulp, and Bower installed.
|
||||
|
||||
When using GitHub-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '4',
|
||||
highlight: 21,
|
||||
},
|
||||
type: 'sub-section',
|
||||
title: 'Example using npm',
|
||||
content: dedent`
|
||||
This example installs the dependencies defined in the *package.json* file. For more information, see [\`npm install\`](https://docs.npmjs.com/cli/install).
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '2',
|
||||
highlight: 21,
|
||||
},
|
||||
type: 'sub-section-2',
|
||||
content: dedent`
|
||||
Using \`npm ci\` installs the versions in the *package-lock.json* or *npm-shrinkwrap.json* file and prevents updates to the lock file. Using \`npm ci\` is generally faster than running \`npm install\`. For more information, see [\`npm ci\`](https://docs.npmjs.com/cli/ci.html) and "[Introducing \`npm ci\` for faster, more reliable builds](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '5',
|
||||
highlight: [21, 23],
|
||||
},
|
||||
type: 'sub-section',
|
||||
title: 'Example using Yarn',
|
||||
content: dedent`
|
||||
This example installs the dependencies defined in the *package.json* file. For more information, see [\`yarn install\`](https://yarnpkg.com/en/docs/cli/install).
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '6',
|
||||
highlight: 21,
|
||||
},
|
||||
type: 'sub-section-2',
|
||||
content: dedent`
|
||||
Alternatively, you can pass \`--frozen-lockfile\` to install the versions in the *yarn.lock* file and prevent updates to the *yarn.lock* file.
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '7',
|
||||
},
|
||||
type: 'sub-section',
|
||||
title: 'Example using a private registry and creating the .npmrc file',
|
||||
content: dedent`
|
||||
You can use the \`setup-node\` action to create a local *.npmrc* file on the runner that configures the default registry and scope. The \`setup-node\` action also accepts an authentication token as input, used to access private registries or publish node packages. For more information, see [\`setup-node\`](https://github.com/actions/setup-node/).
|
||||
|
||||
To authenticate to your private registry, you'll need to store your npm authentication token as a secret. For example, create a repository secret called \`NPM_TOKEN\`. For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
|
||||
In this example, the secret \`NPM_TOKEN\` stores the npm authentication token. The \`setup-node\` action configures the *.npmrc* file to read the npm authentication token from the \`NODE_AUTH_TOKEN\` environment variable. When using the \`setup-node\` action to create an *.npmrc* file, you must set the \`NODE_AUTH_TOKEN\` environment variable with the secret that contains your npm authentication token.
|
||||
|
||||
Before installing dependencies, use the \`setup-node\` action to create the *.npmrc* file. The action has two input parameters. The \`node-version\` parameter sets the Node.js version, and the \`registry-url\` parameter sets the default registry. If your package registry uses scopes, you must use the \`scope\` parameter. For more information, see [\`npm-scope\`](https://docs.npmjs.com/misc/scope).
|
||||
|
||||
This example creates an *.npmrc* file with the following contents:
|
||||
|
||||
\`\`\`ini
|
||||
//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}
|
||||
@octocat:registry=https://registry.npmjs.org/
|
||||
always-auth=true
|
||||
\`\`\`
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '8',
|
||||
},
|
||||
type: 'sub-section',
|
||||
title: 'Example caching dependencies',
|
||||
content: dedent`
|
||||
|
||||
When using GitHub-hosted runners, you can cache and restore the dependencies using the [\`setup-node\` action](https://github.com/actions/setup-node). To cache dependencies with the \`setup-node\` action, you must have a \`package-lock.json\`, \`yarn.lock\`, or \`pnpm-lock.yaml\` file in the root of the repository.
|
||||
|
||||
If you have a custom requirement or need finer controls for caching, you can use the [\`cache\` action](https://github.com/marketplace/actions/cache). For more information, see [Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows) and the [\`cache\` action](https://github.com/marketplace/actions/cache).
|
||||
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '9',
|
||||
highlight: [21, 22],
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Building and testing your code',
|
||||
content: dedent`
|
||||
You can use the same commands that you use locally to build and test your code. For example, if you run \`npm run build\` to run build steps defined in your *package.json* file and \`npm test\` to run your test suite, you would add those commands in your workflow file.
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '9',
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Packaging workflow data as artifacts',
|
||||
content: dedent`
|
||||
You can save artifacts from your build and test steps to view after a job completes. For example, you may need to save log files, core dumps, test results, or screenshots. For more information, see "[Persisting workflow data using artifacts](/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
codeBlock: {
|
||||
id: '9',
|
||||
},
|
||||
type: 'default',
|
||||
title: 'Publishing to package registries',
|
||||
content: dedent`
|
||||
You can configure your workflow to publish your Node.js package to a package registry after your CI tests pass. For more information about publishing to npm and GitHub Packages, see "[Publishing Node.js packages](/actions/automating-your-workflow-with-github-actions/publishing-nodejs-packages)."
|
||||
`,
|
||||
},
|
||||
],
|
||||
codeBlocks: {
|
||||
'0': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js \${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: \${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
'1': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [8.16.2, 10.17.0]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js \${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: \${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
'2': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
'3': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
'4': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
'5': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
- run: yarn run build
|
||||
- run: yarn run test
|
||||
`,
|
||||
},
|
||||
'6': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
- run: yarn run build
|
||||
- run: yarn run test
|
||||
`,
|
||||
},
|
||||
'7': [
|
||||
{
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
always-auth: true
|
||||
node-version: '12.x'
|
||||
registry-url: https://registry.npmjs.org
|
||||
scope: '@octocat'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
NODE_AUTH_TOKEN: \${{secrets.NPM_TOKEN}}
|
||||
`,
|
||||
},
|
||||
{
|
||||
fileName: '.npmrc',
|
||||
language: 'ini',
|
||||
code: dedent`
|
||||
//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}
|
||||
@octocat:registry=https://registry.npmjs.org/
|
||||
always-auth=true
|
||||
`,
|
||||
},
|
||||
],
|
||||
'8': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
cache: 'npm'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
`,
|
||||
},
|
||||
'9': {
|
||||
fileName: '.github/workflows/example.yml',
|
||||
language: 'yaml',
|
||||
code: dedent`
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default article
|
||||
@@ -1,564 +0,0 @@
|
||||
import dedent from 'ts-dedent'
|
||||
import { PlaygroundArticleT } from 'components/playground/types'
|
||||
|
||||
const article: PlaygroundArticleT = {
|
||||
title: 'Building and testing Python',
|
||||
shortTitle: 'Build & test Python',
|
||||
topics: ['CI', 'Python'],
|
||||
type: 'tutorial',
|
||||
slug: '/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python',
|
||||
originalArticle: '/actions/automating-builds-and-tests/building-and-testing-python',
|
||||
codeLanguageId: 'py',
|
||||
intro: dedent`
|
||||
This guide shows you how to build, test, and publish a Python package.
|
||||
|
||||
GitHub-hosted runners have a tools cache with pre-installed software, which includes Python and PyPy. You don't have to install anything! For a full list of up-to-date software and the pre-installed versions of Python and PyPy, see "[Specifications for GitHub-hosted runners](/actions/reference/specifications-for-github-hosted-runners/#supported-software)".
|
||||
`,
|
||||
prerequisites: dedent`
|
||||
You should be familiar with YAML and the syntax for GitHub Actions. For more information, see "[Learn GitHub-Actions](/actions/learn-github-actions)."
|
||||
|
||||
We recommend that you have a basic understanding of Python, PyPy, and pip. For more information, see:
|
||||
- [Getting started with Python](https://www.python.org/about/gettingstarted/)
|
||||
- [PyPy](https://pypy.org/)
|
||||
- [Pip package manager](https://pypi.org/project/pip/)
|
||||
`,
|
||||
contentBlocks: [
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '0',
|
||||
},
|
||||
title: 'Using the Python starter workflow',
|
||||
content: dedent`
|
||||
GitHub provides a Python starter workflow that should work for most Python projects. This guide includes examples that you can use to customize the starter workflow. For more information, see the [Python starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml).
|
||||
|
||||
To get started quickly, add the starter workflow to the \`.github/workflows\` directory of your repository.
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '0',
|
||||
},
|
||||
title: 'Specifying a Python version',
|
||||
content: dedent`
|
||||
To use a pre-installed version of Python or PyPy on a GitHub-hosted runner, use the \`setup-python\` action. This action finds a specific version of Python or PyPy from the tools cache on each runner and adds the necessary binaries to \`PATH\`, which persists for the rest of the job. If a specific version of Python is not pre-installed in the tools cache, the \`setup-python\` action will download and set up the appropriate version from the [\`python-versions\`](https://github.com/actions/python-versions) repository.
|
||||
|
||||
Using the \`setup-python\` action is the recommended way of using Python with GitHub Actions because it ensures consistent behavior across different runners and different versions of Python. If you are using a self-hosted runner, you must install Python and add it to \`PATH\`. For more information, see the [\`setup-python\` action](https://github.com/marketplace/actions/setup-python).
|
||||
|
||||
The table below describes the locations for the tools cache in each GitHub-hosted runner.
|
||||
|
||||
|| Ubuntu | Mac | Windows |
|
||||
|------|-------|------|----------|
|
||||
|**Tool Cache Directory** |\`/opt/hostedtoolcache/*\`|\`/Users/runner/hostedtoolcache/*\`|\`C:\hostedtoolcache\windows\*\`|
|
||||
|**Python Tool Cache**|\`/opt/hostedtoolcache/Python/*\`|\`/Users/runner/hostedtoolcache/Python/*\`|\`C:\hostedtoolcache\windows\Python\*\`|
|
||||
|**PyPy Tool Cache**|\`/opt/hostedtoolcache/PyPy/*\`|\`/Users/runner/hostedtoolcache/PyPy/*\`|\`C:\hostedtoolcache\windows\PyPy\*\`|
|
||||
|
||||
If you are using a self-hosted runner, you can configure the runner to use the \`setup-python\` action to manage your dependencies. For more information, see [using setup-python with a self-hosted runner](https://github.com/actions/setup-python#using-setup-python-with-a-self-hosted-runner) in the \`setup-python\` README.
|
||||
|
||||
GitHub supports semantic versioning syntax. For more information, see "[Using semantic versioning](https://docs.npmjs.com/about-semantic-versioning#using-semantic-versioning-to-specify-update-types-your-package-can-accept)" and the "[Semantic versioning specification](https://semver.org/)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '1',
|
||||
},
|
||||
title: 'Using multiple Python versions',
|
||||
content: dedent`
|
||||
This example uses a matrix to run the job on multiple Python versions: 2.7, 3.6, 3.7, 3.8, and 3.9. For more information about matrix strategies and contexts, see "[Workflow syntax for GitHub Actions](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)" and "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '2',
|
||||
},
|
||||
title: 'Using a specific Python version',
|
||||
content: dedent`
|
||||
You can configure a specific version of python. For example, 3.8. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest minor release of Python 3.
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '3',
|
||||
},
|
||||
title: 'Excluding a version',
|
||||
content: dedent`
|
||||
If you specify a version of Python that is not available, \`setup-python\` fails with an error such as: \`##[error]Version 3.4 with arch x64 not found\`. The error message includes the available versions.
|
||||
|
||||
You can also use the \`exclude\` keyword in your workflow if there is a configuration of Python that you do not wish to run. For more information, see "[Workflow syntax for GitHub Actions](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '3',
|
||||
},
|
||||
title: 'Using the default Python version',
|
||||
content: dedent`
|
||||
We recommend using \`setup-python\` to configure the version of Python used in your workflows because it helps make your dependencies explicit. If you don't use \`setup-python\`, the default version of Python set in \`PATH\` is used in any shell when you call \`python\`. The default version of Python varies between GitHub-hosted runners, which may cause unexpected changes or use an older version than expected.
|
||||
|
||||
| GitHub-hosted runner | Description |
|
||||
|----|----|
|
||||
| Ubuntu | Ubuntu runners have multiple versions of system Python installed under \`/usr/bin/python\` and \`/usr/bin/python3\`. The Python versions that come packaged with Ubuntu are in addition to the versions that GitHub installs in the tools cache. |
|
||||
| Windows | Excluding the versions of Python that are in the tools cache, Windows does not ship with an equivalent version of system Python. To maintain consistent behavior with other runners and to allow Python to be used out-of-the-box without the \`setup-python\` action, GitHub adds a few versions from the tools cache to \`PATH\`.|
|
||||
| macOS | The macOS runners have more than one version of system Python installed, in addition to the versions that are part of the tools cache. The system Python versions are located in the \`/usr/local/Cellar/python/*\` directory. |
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '4',
|
||||
},
|
||||
title: 'Installing dependencies',
|
||||
content: dedent`
|
||||
GitHub-hosted runners have the pip package manager installed. You can use pip to install dependencies from the PyPI package registry before building and testing your code. This example installs or upgrades the \`pip\` package installer and the \`setuptools\` and \`wheel\` packages.
|
||||
|
||||
When using GitHub-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '5',
|
||||
},
|
||||
title: 'Requirements file',
|
||||
content: dedent`
|
||||
After you update \`pip\`, a typical next step is to install dependencies from *requirements.txt*.
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '6',
|
||||
},
|
||||
title: 'Caching Dependencies',
|
||||
content: dedent`
|
||||
|
||||
When using GitHub-hosted runners, you can cache and restore the dependencies using the [\`setup-python\` action](https://github.com/actions/setup-python). By default, the \`setup-python\` action searches for the dependency file (\`requirements.txt\` for pip or \`Pipfile.lock\` for pipenv) in the whole repository.
|
||||
|
||||
If you have a custom requirement or need finer controls for caching, you can use the [\`cache\` action](https://github.com/marketplace/actions/cache). Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example shown here, depending on the operating system you use. For more information, see [Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows) and the [\`cache\` action](https://github.com/marketplace/actions/cache).
|
||||
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '7',
|
||||
},
|
||||
title: 'Testing your code',
|
||||
content: dedent`
|
||||
You can use the same commands that you use locally to build and test your code.
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '7',
|
||||
},
|
||||
title: 'Testing with pytest and pytest-cov',
|
||||
content: dedent`
|
||||
This example installs or upgrades \`pytest\` and \`pytest-cov\`. Tests are then run and output in JUnit format while code coverage results are output in Cobertura. For more information, see [JUnit](https://junit.org/junit5/) and [Cobertura](https://cobertura.github.io/cobertura/).
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '8',
|
||||
},
|
||||
title: 'Using Flake8 to lint code',
|
||||
content: dedent`
|
||||
This example installs or upgrades \`flake8\` and uses it to lint all files. For more information, see [Flake8](http://flake8.pycqa.org/en/latest/).
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'sub-section',
|
||||
codeBlock: {
|
||||
id: '9',
|
||||
},
|
||||
title: 'Running tests with tox',
|
||||
content: dedent`
|
||||
With GitHub Actions, you can run tests with tox and spread the work across multiple jobs. You'll need to invoke tox using the \`-e py\` option to choose the version of Python in your \`PATH\`, rather than specifying a specific version. For more information, see [tox](https://tox.readthedocs.io/en/latest/).
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '10',
|
||||
},
|
||||
title: 'Packaging workflow data as artifacts',
|
||||
content: dedent`
|
||||
You can upload artifacts to view after a workflow completes. For example, you may need to save log files, core dumps, test results, or screenshots. For more information, see "[Persisting workflow data using artifacts](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)."
|
||||
|
||||
This example demonstrates how you can use the \`upload-artifact\` action to archive test results from running \`pytest\`. For more information, see the [\`upload-artifact\` action](https://github.com/actions/upload-artifact).
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'default',
|
||||
codeBlock: {
|
||||
id: '11',
|
||||
},
|
||||
title: 'Publishing to package registries',
|
||||
content: dedent`
|
||||
You can configure your workflow to publish your Python package to a package registry once your CI tests pass. This example demonstrates how you can use GitHub Actions to upload your package to PyPI each time you [publish a release](/github/administering-a-repository/managing-releases-in-a-repository).
|
||||
|
||||
For this example, you will need to create two [PyPI API tokens](https://pypi.org/help/#apitoken). You can use secrets to store the access tokens or credentials needed to publish your package. For more information, see "[Creating and using encrypted secrets](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
|
||||
For more information about the starter workflow, see [\`python-publish\`](https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml).
|
||||
`,
|
||||
},
|
||||
],
|
||||
codeBlocks: {
|
||||
'0': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python \${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: \${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
`,
|
||||
},
|
||||
'1': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# You can use PyPy versions in python-version.
|
||||
# For example, pypy2 and pypy3
|
||||
matrix:
|
||||
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python \${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: \${{ matrix.python-version }}
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Display Python version
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
`,
|
||||
},
|
||||
'2': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Display Python version
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
`,
|
||||
},
|
||||
'3': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: \${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", pypy2, pypy3]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: "3.6"
|
||||
- os: windows-latest
|
||||
python-version: "3.6"
|
||||
`,
|
||||
},
|
||||
'4': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: python -m pip install --upgrade pip setuptools wheel
|
||||
`,
|
||||
},
|
||||
'5': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
`,
|
||||
},
|
||||
'6': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
cache: 'pip'
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
`,
|
||||
},
|
||||
'7': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pip install pytest
|
||||
pip install pytest-cov
|
||||
pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|
||||
`,
|
||||
},
|
||||
'8': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
pip install flake8
|
||||
flake8 .
|
||||
`,
|
||||
},
|
||||
'9': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python: ["3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: \${{ matrix.python }}
|
||||
- name: Install Tox and any other packages
|
||||
run: pip install tox
|
||||
- name: Run Tox
|
||||
# Run tox using the version of Python in \`PATH\`
|
||||
run: tox -e py
|
||||
`,
|
||||
},
|
||||
'10': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python # Set Python version
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: \${{ matrix.python-version }}
|
||||
# Install pip and pytest
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
- name: Test with pytest
|
||||
run: pytest tests.py --doctest-modules --junitxml=junit/test-results-\${{ matrix.python-version }}.xml
|
||||
- name: Upload pytest test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pytest-results-\${{ matrix.python-version }}
|
||||
path: junit/test-results-\${{ matrix.python-version }}.xml
|
||||
# Use always() to always run this step to publish test results when there are test failures
|
||||
if: \${{ always() }}
|
||||
`,
|
||||
},
|
||||
'11': {
|
||||
language: 'yaml',
|
||||
fileName: '.github/workflows/example.yml',
|
||||
code: dedent`
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||
with:
|
||||
user: __token__
|
||||
password: \${{ secrets.PYPI_API_TOKEN }}
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default article
|
||||
@@ -10,7 +10,7 @@ export function RestPreviewNotice({ slug, previews }: Props) {
|
||||
return (
|
||||
<>
|
||||
<h3 className="h4" id={`${slug}-preview-notices`}>
|
||||
<a href={`${slug}-preview-notices`}>
|
||||
<a href={`#${slug}-preview-notices`}>
|
||||
{previews.length > 1
|
||||
? `${t('rest.reference.preview_notices')}`
|
||||
: `${t('rest.reference.preview_notice')}`}
|
||||
|
||||
@@ -37,7 +37,7 @@ topics:
|
||||
- Profiles
|
||||
- Notifications
|
||||
children:
|
||||
- /setting-up-and-managing-your-github-user-account
|
||||
- /setting-up-and-managing-your-personal-account-on-github
|
||||
- /setting-up-and-managing-your-github-profile
|
||||
- /managing-subscriptions-and-notifications-on-github
|
||||
---
|
||||
|
||||
@@ -129,8 +129,8 @@ Email notifications from {% data variables.product.product_location %} contain t
|
||||
| --- | --- |
|
||||
| `From` address | This address will always be {% ifversion fpt or ghec %}'`notifications@github.com`'{% else %}'the no-reply email address configured by your site administrator'{% endif %}. |
|
||||
| `To` field | This field connects directly to the thread.{% ifversion not ghae %} If you reply to the email, you'll add a new comment to the conversation.{% endif %} |
|
||||
| `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% data variables.notifications.cc_address %}. The possible notification reasons are: <ul><li>`assign`: You were assigned to an issue or pull request.</li><li>`author`: You created an issue or pull request.</li><li>`ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.</li><li>`comment`: You commented on an issue or pull request.</li><li>`manual`: There was an update to an issue or pull request you manually subscribed to.</li><li>`mention`: You were mentioned on an issue or pull request.</li><li>`push`: Someone committed to a pull request you're subscribed to.</li><li>`review_requested`: You or a team you're a member of was requested to review a pull request.</li>{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}<li>`security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.</li>{% endif %}<li>`state_change`: An issue or pull request you're subscribed to was either closed or opened.</li><li>`subscribed`: There was an update in a repository you're watching.</li><li>`team_mention`: A team you belong to was mentioned on an issue or pull request.</li><li>`your_activity`: You opened, commented on, or closed an issue or pull request.</li></ul> |
|
||||
| `mailing list` field | This field identifies the name of the repository and its owner. The format of this address is always `<repository name>.<repository owner>.{% data variables.command_line.backticks %}`. |{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
| `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% data variables.notifications.cc_address %}. The possible notification reasons are: <ul><li>`assign`: You were assigned to an issue or pull request.</li><li>`author`: You created an issue or pull request.</li><li>`ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.</li><li>`comment`: You commented on an issue or pull request.</li><li>`manual`: There was an update to an issue or pull request you manually subscribed to.</li><li>`mention`: You were mentioned on an issue or pull request.</li><li>`push`: Someone committed to a pull request you're subscribed to.</li><li>`review_requested`: You or a team you're a member of was requested to review a pull request.</li>{% ifversion fpt or ghes or ghae or ghec %}<li>`security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.</li>{% endif %}<li>`state_change`: An issue or pull request you're subscribed to was either closed or opened.</li><li>`subscribed`: There was an update in a repository you're watching.</li><li>`team_mention`: A team you belong to was mentioned on an issue or pull request.</li><li>`your_activity`: You opened, commented on, or closed an issue or pull request.</li></ul> |
|
||||
| `mailing list` field | This field identifies the name of the repository and its owner. The format of this address is always `<repository name>.<repository owner>.{% data variables.command_line.backticks %}`. |{% ifversion fpt or ghes or ghae or ghec %}
|
||||
| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:<ul><li>`low`</li><li>`moderate`</li><li>`high`</li><li>`critical`</li></ul>For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." |{% endif %}
|
||||
|
||||
## Choosing your notification settings
|
||||
@@ -139,7 +139,7 @@ Email notifications from {% data variables.product.product_location %} contain t
|
||||
{% data reusables.notifications-v2.manage-notifications %}
|
||||
3. On the notifications settings page, choose how you receive notifications when:
|
||||
- There are updates in repositories or team discussions you're watching or in a conversation you're participating in. For more information, see "[About participating and watching notifications](#about-participating-and-watching-notifications)."
|
||||
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."{% ifversion fpt or ghes or ghae or ghec %}
|
||||
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} notification options](#dependabot-alerts-notification-options)." {% endif %} {% ifversion fpt or ghec %}
|
||||
- There are workflow runs updates on repositories set up with {% data variables.product.prodname_actions %}. For more information, see "[{% data variables.product.prodname_actions %} notification options](#github-actions-notification-options)."{% endif %}{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5668 %}
|
||||
- There are new deploy keys added to repositories that belong to organizations that you're an owner of. For more information, see "[Organization alerts notification options](#organization-alerts-notification-options)."{% endif %}
|
||||
@@ -194,7 +194,7 @@ If you are a member of more than one organization, you can configure each one to
|
||||
5. Select one of your verified email addresses, then click **Save**.
|
||||

|
||||
|
||||
{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
{% ifversion fpt or ghes or ghae or ghec %}
|
||||
## {% data variables.product.prodname_dependabot_alerts %} notification options
|
||||
|
||||
{% data reusables.notifications.vulnerable-dependency-notification-enable %}
|
||||
|
||||
@@ -112,13 +112,13 @@ To filter notifications for specific activity on {% data variables.product.produ
|
||||
- `is:gist`
|
||||
- `is:issue-or-pull-request`
|
||||
- `is:release`
|
||||
- `is:repository-invitation`{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
- `is:repository-invitation`{% ifversion fpt or ghes or ghae or ghec %}
|
||||
- `is:repository-vulnerability-alert`{% endif %}{% ifversion fpt or ghec %}
|
||||
- `is:repository-advisory`{% endif %}
|
||||
- `is:team-discussion`{% ifversion fpt or ghec %}
|
||||
- `is:discussion`{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
{% ifversion fpt or ghes or ghae or ghec %}
|
||||
For information about reducing noise from notifications for {% data variables.product.prodname_dependabot_alerts %}, see "[Configuring notifications for vulnerable dependencies](/github/managing-security-vulnerabilities/configuring-notifications-for-vulnerable-dependencies)."
|
||||
{% endif %}
|
||||
|
||||
@@ -142,7 +142,7 @@ To filter notifications by why you've received an update, you can use the `reaso
|
||||
| `reason:invitation` | When you're invited to a team, organization, or repository.
|
||||
| `reason:manual` | When you click **Subscribe** on an issue or pull request you weren't already subscribed to.
|
||||
| `reason:mention` | You were directly @mentioned.
|
||||
| `reason:review-requested` | You or a team you're on have been requested to review a pull request.{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
| `reason:review-requested` | You or a team you're on have been requested to review a pull request.{% ifversion fpt or ghes or ghae or ghec %}
|
||||
| `reason:security-alert` | When a security alert is issued for a repository.{% endif %}
|
||||
| `reason:state-change` | When the state of a pull request or issue is changed. For example, an issue is closed or a pull request is merged.
|
||||
| `reason:team-mention` | When a team you're a member of is @mentioned.
|
||||
@@ -161,7 +161,7 @@ For example, to see notifications from the octo-org organization, use `org:octo-
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
{% ifversion fpt or ghes or ghae or ghec %}
|
||||
## {% data variables.product.prodname_dependabot %} custom filters
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.2 %}
|
||||
@@ -173,7 +173,7 @@ If you use {% data variables.product.prodname_dependabot %} to keep your depende
|
||||
For more information about {% data variables.product.prodname_dependabot %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)."
|
||||
{% endif %}
|
||||
|
||||
{% ifversion ghes < 3.3 or ghae-issue-4864 %}
|
||||
{% ifversion ghes < 3.3 or ghae %}
|
||||
|
||||
If you use {% data variables.product.prodname_dependabot %} to tell you about vulnerable dependencies, you can use and save these custom filters to show notifications for {% data variables.product.prodname_dependabot_alerts %}:
|
||||
- `is:repository_vulnerability_alert`
|
||||
|
||||
@@ -91,10 +91,7 @@ The contribution activity section includes a detailed timeline of your work, inc
|
||||
|
||||

|
||||
|
||||
{% ifversion fpt or ghes or ghae or ghec %}
|
||||
|
||||
## Viewing contributions from {% data variables.product.prodname_enterprise %} on {% data variables.product.prodname_dotcom_the_website %}
|
||||
|
||||
If you use {% ifversion fpt or ghec %}{% data variables.product.prodname_ghe_server %}{% ifversion ghae %} or {% data variables.product.prodname_ghe_managed %}{% endif %}{% else %}{% data variables.product.product_name %}{% endif %} and your enterprise owner enables {% data variables.product.prodname_unified_contributions %}, you can send enterprise contribution counts from to your {% data variables.product.prodname_dotcom_the_website %} profile. For more information, see "[Sending enterprise contributions to your {% data variables.product.prodname_dotcom_the_website %} profile](/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-graphs-on-your-profile/sending-enterprise-contributions-to-your-githubcom-profile)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
---
|
||||
title: Changing your GitHub username
|
||||
intro: 'You can change the username for your account on {% ifversion fpt or ghec %}{% data variables.product.prodname_dotcom_the_website %}{% elsif ghes %}{% data variables.product.product_location %} if your instance uses built-in authentication{% endif %}.'
|
||||
redirect_from:
|
||||
- /articles/how-to-change-your-username
|
||||
- /articles/changing-your-github-user-name
|
||||
- /articles/renaming-a-user
|
||||
- /articles/what-happens-when-i-change-my-username
|
||||
- /articles/changing-your-github-username
|
||||
- /github/setting-up-and-managing-your-github-user-account/changing-your-github-username
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/changing-your-github-username
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Accounts
|
||||
shortTitle: Change your username
|
||||
---
|
||||
|
||||
{% ifversion ghec or ghes %}
|
||||
|
||||
{% note %}
|
||||
|
||||
{% ifversion ghec %}
|
||||
|
||||
**Note**: Members of an {% data variables.product.prodname_emu_enterprise %} cannot change usernames. Your enterprise's IdP administrator controls your username for {% data variables.product.product_name %}. For more information, see "[About {% data variables.product.prodname_emus %}](/admin/authentication/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users)."
|
||||
|
||||
{% elsif ghes %}
|
||||
|
||||
**Note**: If you sign into {% data variables.product.product_location %} with LDAP credentials or single sign-on (SSO), only your local administrator can change your username. For more information about authentication methods for {% data variables.product.product_name %}, see "[Authenticating users for {% data variables.product.product_location %}](/admin/authentication/authenticating-users-for-your-github-enterprise-server-instance)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
## About username changes
|
||||
|
||||
You can change your username to another username that is not currently in use.{% ifversion fpt or ghec %} If the username you want is not available, consider other names or unique variations. Using a number, hyphen, or an alternative spelling might help you find a similar username that's still available.
|
||||
|
||||
If you hold a trademark for the username, you can find more information about making a trademark complaint on our [Trademark Policy](/free-pro-team@latest/github/site-policy/github-trademark-policy) page.
|
||||
|
||||
If you do not hold a trademark for the name, you can choose another username or keep your current username. {% data variables.contact.github_support %} cannot release the unavailable username for you. For more information, see "[Changing your username](#changing-your-username)."{% endif %}
|
||||
|
||||
After changing your username, your old username becomes available for anyone else to claim. Most references to your repositories under the old username automatically change to the new username. However, some links to your profile won't automatically redirect.
|
||||
|
||||
{% data variables.product.product_name %} cannot set up redirects for:
|
||||
- [@mentions](/articles/basic-writing-and-formatting-syntax/#mentioning-people-and-teams) using your old username
|
||||
- Links to [gists](/articles/creating-gists) that include your old username
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
If you're a member of an {% data variables.product.prodname_emu_enterprise %}, you cannot make changes to your username. {% data reusables.enterprise-accounts.emu-more-info-account %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
## Repository references
|
||||
|
||||
After you change your username, {% data variables.product.product_name %} will automatically redirect references to your repositories.
|
||||
- Web links to your existing repositories will continue to work. This can take a few minutes to complete after you make the change.
|
||||
- Command line pushes from your local repository clones to the old remote tracking URLs will continue to work.
|
||||
|
||||
If the new owner of your old username creates a repository with the same name as your repository, that will override the redirect entry and your redirect will stop working. Because of this possibility, we recommend you update all existing remote repository URLs after changing your username. For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
## Links to your previous profile page
|
||||
|
||||
After changing your username, links to your previous profile page, such as `https://{% data variables.command_line.backticks %}/previoususername`, will return a 404 error. We recommend updating any links to your account on {% data variables.product.product_location %} from elsewhere{% ifversion fpt or ghec %}, such as your LinkedIn or Twitter profile{% endif %}.
|
||||
|
||||
## Your Git commits
|
||||
|
||||
{% ifversion fpt or ghec %}Git commits that were associated with your {% data variables.product.product_name %}-provided `noreply` email address won't be attributed to your new username and won't appear in your contributions graph.{% endif %} If your Git commits are associated with another email address you've [added to your GitHub account](/articles/adding-an-email-address-to-your-github-account), {% ifversion fpt or ghec %}including the ID-based {% data variables.product.product_name %}-provided `noreply` email address, {% endif %}they'll continue to be attributed to you and appear in your contributions graph after you've changed your username. For more information on setting your email address, see "[Setting your commit email address](/articles/setting-your-commit-email-address)."
|
||||
|
||||
## Changing your username
|
||||
|
||||
{% data reusables.user-settings.access_settings %}
|
||||
{% data reusables.user-settings.account_settings %}
|
||||
3. In the "Change username" section, click **Change username**.
|
||||
{% ifversion fpt or ghec %}
|
||||
4. Read the warnings about changing your username. If you still want to change your username, click **I understand, let's change my username**.
|
||||

|
||||
5. Type a new username.
|
||||

|
||||
6. If the username you've chosen is available, click **Change my username**. If the username you've chosen is unavailable, you can try a different username or one of the suggestions you see.
|
||||

|
||||
{% endif %}
|
||||
|
||||
## Further reading
|
||||
|
||||
- "[Why are my commits linked to the wrong user?](/pull-requests/committing-changes-to-your-project/troubleshooting-commits/why-are-my-commits-linked-to-the-wrong-user)"{% ifversion fpt or ghec %}
|
||||
- "[{% data variables.product.prodname_dotcom %} Username Policy](/free-pro-team@latest/github/site-policy/github-username-policy)"{% endif %}
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
title: GitHub ユーザアカウントの設定と管理
|
||||
intro: 'You can manage settings in your GitHub personal account including email preferences, collaborator access for personal repositories, and organization memberships.'
|
||||
title: Setting up and managing your personal account on GitHub
|
||||
intro: 'You can manage settings for your personal account on {% data variables.product.prodname_dotcom %}, including email preferences, collaborator access for personal repositories, and organization memberships.'
|
||||
shortTitle: Personal accounts
|
||||
redirect_from:
|
||||
- /categories/setting-up-and-managing-your-github-user-account
|
||||
- /github/setting-up-and-managing-your-github-user-account
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -13,7 +14,7 @@ versions:
|
||||
topics:
|
||||
- Accounts
|
||||
children:
|
||||
- /managing-user-account-settings
|
||||
- /managing-personal-account-settings
|
||||
- /managing-email-preferences
|
||||
- /managing-access-to-your-personal-repositories
|
||||
- /managing-your-membership-in-organizations
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /categories/managing-repository-collaborators
|
||||
- /articles/managing-access-to-your-personal-repositories
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories
|
||||
product: '{% data reusables.gated-features.user-repo-collaborators %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -19,7 +20,7 @@ children:
|
||||
- /inviting-collaborators-to-a-personal-repository
|
||||
- /removing-a-collaborator-from-a-personal-repository
|
||||
- /removing-yourself-from-a-collaborators-repository
|
||||
- /maintaining-ownership-continuity-of-your-user-accounts-repositories
|
||||
- /maintaining-ownership-continuity-of-your-personal-accounts-repositories
|
||||
shortTitle: Access to your repositories
|
||||
---
|
||||
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/inviting-collaborators-to-a-personal-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/inviting-collaborators-to-a-personal-repository
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/inviting-collaborators-to-a-personal-repository
|
||||
product: '{% data reusables.gated-features.user-repo-collaborators %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Maintaining ownership continuity of your user account's repositories
|
||||
title: Maintaining ownership continuity of your personal account's repositories
|
||||
intro: You can invite someone to manage your user owned repositories if you are not able to.
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,6 +10,7 @@ topics:
|
||||
redirect_from:
|
||||
- /github/setting-up-and-managing-your-github-user-account/maintaining-ownership-continuity-of-your-user-accounts-repositories
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/maintaining-ownership-continuity-of-your-user-accounts-repositories
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/maintaining-ownership-continuity-of-your-user-accounts-repositories
|
||||
shortTitle: Ownership continuity
|
||||
---
|
||||
## About successors
|
||||
@@ -10,6 +10,7 @@ redirect_from:
|
||||
- /articles/removing-a-collaborator-from-a-personal-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/removing-a-collaborator-from-a-personal-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/removing-a-collaborator-from-a-personal-repository
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/removing-a-collaborator-from-a-personal-repository
|
||||
product: '{% data reusables.gated-features.user-repo-collaborators %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -9,6 +9,7 @@ redirect_from:
|
||||
- /articles/removing-yourself-from-a-collaborators-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/removing-yourself-from-a-collaborators-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/removing-yourself-from-a-collaborators-repository
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/removing-yourself-from-a-collaborators-repository
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/adding-an-email-address-to-your-github-account
|
||||
- /github/setting-up-and-managing-your-github-user-account/adding-an-email-address-to-your-github-account
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/adding-an-email-address-to-your-github-account
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/adding-an-email-address-to-your-github-account
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/blocking-command-line-pushes-that-expose-your-personal-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/blocking-command-line-pushes-that-expose-your-personal-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/blocking-command-line-pushes-that-expose-your-personal-email-address
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/blocking-command-line-pushes-that-expose-your-personal-email-address
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/changing-your-primary-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/changing-your-primary-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/changing-your-primary-email-address
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/changing-your-primary-email-address
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /categories/managing-email-preferences
|
||||
- /articles/managing-email-preferences
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/managing-marketing-emails-from-github
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-marketing-emails-from-github
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/managing-marketing-emails-from-github
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/managing-marketing-emails-from-github
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/remembering-your-github-username-or-email
|
||||
- /github/setting-up-and-managing-your-github-user-account/remembering-your-github-username-or-email
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/remembering-your-github-username-or-email
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/remembering-your-github-username-or-email
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/setting-a-backup-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/setting-a-backup-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-a-backup-email-address
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-a-backup-email-address
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -12,6 +12,7 @@ redirect_from:
|
||||
- /articles/setting-your-commit-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/types-of-emails-github-sends
|
||||
- /github/setting-up-and-managing-your-github-user-account/types-of-emails-github-sends
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-email-preferences/types-of-emails-github-sends
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/types-of-emails-github-sends
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /articles/about-your-personal-dashboard
|
||||
- /github/setting-up-and-managing-your-github-user-account/about-your-personal-dashboard
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/about-your-personal-dashboard
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/about-your-personal-dashboard
|
||||
intro: 'You can visit your personal dashboard to keep track of issues and pull requests you''re working on or following, navigate to your top repositories and team pages, stay updated on recent activities in organizations and repositories you''re subscribed to, and explore recommended repositories.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/best-practices-for-leaving-your-company
|
||||
- /github/setting-up-and-managing-your-github-user-account/best-practices-for-leaving-your-company
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/best-practices-for-leaving-your-company
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/best-practices-for-leaving-your-company
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -9,6 +9,7 @@ redirect_from:
|
||||
- /articles/changing-your-github-username
|
||||
- /github/setting-up-and-managing-your-github-user-account/changing-your-github-username
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/changing-your-github-username
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/changing-your-github-username
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /articles/converting-a-user-into-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/converting-a-user-into-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/converting-a-user-into-an-organization
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/converting-a-user-into-an-organization
|
||||
intro: You can convert your personal account into an organization. This allows more granular permissions for repositories that belong to the organization.
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
title: Deleting your user account
|
||||
title: Deleting your personal account
|
||||
intro: 'You can delete your personal account on {% data variables.product.product_name %} at any time.'
|
||||
redirect_from:
|
||||
- /articles/deleting-a-user-account
|
||||
- /articles/deleting-your-user-account
|
||||
- /github/setting-up-and-managing-your-github-user-account/deleting-your-user-account
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/deleting-your-user-account
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/deleting-your-user-account
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /categories/user-accounts
|
||||
- /articles/managing-user-account-settings
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -18,15 +19,15 @@ children:
|
||||
- /managing-your-theme-settings
|
||||
- /managing-your-tab-size-rendering-preference
|
||||
- /changing-your-github-username
|
||||
- /merging-multiple-user-accounts
|
||||
- /merging-multiple-personal-accounts
|
||||
- /converting-a-user-into-an-organization
|
||||
- /deleting-your-user-account
|
||||
- /permission-levels-for-a-user-account-repository
|
||||
- /permission-levels-for-user-owned-project-boards
|
||||
- /deleting-your-personal-account
|
||||
- /permission-levels-for-a-personal-account-repository
|
||||
- /permission-levels-for-a-project-board-owned-by-a-personal-account
|
||||
- /managing-accessibility-settings
|
||||
- /managing-the-default-branch-name-for-your-repositories
|
||||
- /managing-security-and-analysis-settings-for-your-user-account
|
||||
- /managing-access-to-your-user-accounts-project-boards
|
||||
- /managing-security-and-analysis-settings-for-your-personal-account
|
||||
- /managing-access-to-your-personal-accounts-project-boards
|
||||
- /integrating-jira-with-your-personal-projects
|
||||
- /best-practices-for-leaving-your-company
|
||||
- /what-does-the-available-for-hire-checkbox-do
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/integrating-jira-with-your-personal-projects
|
||||
- /github/setting-up-and-managing-your-github-user-account/integrating-jira-with-your-personal-projects
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/integrating-jira-with-your-personal-projects
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/integrating-jira-with-your-personal-projects
|
||||
versions:
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Managing access to your user account's project boards
|
||||
title: Managing access to your personal account's project boards
|
||||
intro: 'As a project board owner, you can add or remove a collaborator and customize their permissions to a project board.'
|
||||
redirect_from:
|
||||
- /articles/managing-project-boards-in-your-repository-or-organization
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/managing-access-to-your-user-accounts-project-boards
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-access-to-your-user-accounts-project-boards
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-access-to-your-user-accounts-project-boards
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-access-to-your-user-accounts-project-boards
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -3,6 +3,8 @@ title: Managing accessibility settings
|
||||
intro: 'You can disable character key shortcuts on {% data variables.product.prodname_dotcom %} in your accessibility settings.'
|
||||
versions:
|
||||
feature: keyboard-shortcut-accessibility-setting
|
||||
redirect_from:
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-accessibility-settings
|
||||
---
|
||||
|
||||
## About accessibility settings
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Managing security and analysis settings for your user account
|
||||
title: Managing security and analysis settings for your personal account
|
||||
intro: 'You can control features that secure and analyze the code in your projects on {% data variables.product.prodname_dotcom %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,6 +10,7 @@ topics:
|
||||
redirect_from:
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-security-and-analysis-settings-for-your-user-account
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account
|
||||
shortTitle: Manage security & analysis
|
||||
---
|
||||
## About management of security and analysis settings
|
||||
@@ -9,6 +9,8 @@ versions:
|
||||
topics:
|
||||
- Accounts
|
||||
shortTitle: Managing your tab size
|
||||
redirect_from:
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-your-tab-size-rendering-preference
|
||||
---
|
||||
|
||||
If you feel that tabbed indentation in code rendered on {% data variables.product.product_name %} takes up too much, or too little space, you can change this in your settings.
|
||||
@@ -11,6 +11,7 @@ topics:
|
||||
redirect_from:
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-theme-settings
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-your-theme-settings
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-your-theme-settings
|
||||
shortTitle: Manage theme settings
|
||||
---
|
||||
|
||||
@@ -18,7 +19,7 @@ For choice and flexibility in how and when you use {% data variables.product.pro
|
||||
|
||||
You may want to use a dark theme to reduce power consumption on certain devices, to reduce eye strain in low-light conditions, or because you prefer how the theme looks.
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4618 or ghec %}If you have low vision, you may benefit from a high contrast theme, with greater contrast between foreground and background elements.{% endif %}{% ifversion fpt or ghae-issue-4619 or ghec %} If you have colorblindness, you may benefit from our light and dark colorblind themes.
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}If you have low vision, you may benefit from a high contrast theme, with greater contrast between foreground and background elements.{% endif %}{% ifversion fpt or ghae or ghec %} If you have colorblindness, you may benefit from our light and dark colorblind themes.
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -31,10 +32,10 @@ You may want to use a dark theme to reduce power consumption on certain devices,
|
||||
1. Click the theme you'd like to use.
|
||||
- If you chose a single theme, click a theme.
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4618 or ghec %}{% else %}{% endif %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}{% else %}{% endif %}
|
||||
- If you chose to follow your system settings, click a day theme and a night theme.
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4618 or ghec %}{% else %}{% endif %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}{% else %}{% endif %}
|
||||
{% ifversion fpt or ghec %}
|
||||
- If you would like to choose a theme which is currently in public beta, you will first need to enable it with feature preview. For more information, see "[Exploring early access releases with feature preview](/get-started/using-github/exploring-early-access-releases-with-feature-preview)."{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Merging multiple user accounts
|
||||
title: Merging multiple personal accounts
|
||||
intro: 'If you have separate accounts for work and personal use, you can merge the accounts.'
|
||||
redirect_from:
|
||||
- /articles/can-i-merge-two-accounts
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/merging-multiple-user-accounts
|
||||
- /github/setting-up-and-managing-your-github-user-account/merging-multiple-user-accounts
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/merging-multiple-user-accounts
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/merging-multiple-user-accounts
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -38,7 +39,7 @@ shortTitle: Merge multiple personal accounts
|
||||
|
||||
1. [Transfer any repositories](/articles/how-to-transfer-a-repository) from the account you want to delete to the account you want to keep. Issues, pull requests, and wikis are transferred as well. Verify the repositories exist on the account you want to keep.
|
||||
2. [Update the remote URLs](/github/getting-started-with-github/managing-remote-repositories) in any local clones of the repositories that were moved.
|
||||
3. [Delete the account](/articles/deleting-your-user-account) you no longer want to use.
|
||||
3. [Delete the account](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/deleting-your-personal-account) you no longer want to use.
|
||||
4. To attribute past commits to the new account, add the email address you used to author the commits to the account you're keeping. For more information, see "[Why are my contributions not showing up on my profile?](/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-graphs-on-your-profile/why-are-my-contributions-not-showing-up-on-my-profile#your-local-git-commit-email-isnt-connected-to-your-account)"
|
||||
|
||||
## Further reading
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
title: Permission levels for a user account repository
|
||||
title: Permission levels for a personal account repository
|
||||
intro: 'A repository owned by a personal account has two permission levels: the repository owner and collaborators.'
|
||||
redirect_from:
|
||||
- /articles/permission-levels-for-a-user-account-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -12,7 +13,7 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Accounts
|
||||
shortTitle: Permission user repositories
|
||||
shortTitle: Repository permissions
|
||||
---
|
||||
## About permissions levels for a personal account repository
|
||||
|
||||
@@ -43,7 +44,7 @@ The repository owner has full control of the repository. In addition to the acti
|
||||
| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %}{% ifversion fpt or ghes > 3.1 or ghec or ghae %}
|
||||
| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% endif %}
|
||||
| Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" |
|
||||
| Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
| Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% ifversion fpt or ghes or ghae or ghec %}
|
||||
| Control access to {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies | "[Managing security and analysis settings for your repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %}
|
||||
| Dismiss {% data variables.product.prodname_dependabot_alerts %} in the repository | "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" |
|
||||
| Manage data use for a private repository | "[Managing data use settings for your private repository](/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository)"|{% endif %}
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
title: Permission levels for user-owned project boards
|
||||
title: Permission levels for a project board owned by a personal account
|
||||
intro: 'A project board owned by a personal account has two permission levels: the project board owner and collaborators.'
|
||||
redirect_from:
|
||||
- /articles/permission-levels-for-user-owned-project-boards
|
||||
- /github/setting-up-and-managing-your-github-user-account/permission-levels-for-user-owned-project-boards
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-user-owned-project-boards
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-user-owned-project-boards
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -12,7 +13,7 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Accounts
|
||||
shortTitle: Permission user project boards
|
||||
shortTitle: Project board permissions
|
||||
---
|
||||
## Permissions overview
|
||||
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/what-does-the-available-for-hire-checkbox-do
|
||||
- /github/setting-up-and-managing-your-github-user-account/what-does-the-available-for-hire-checkbox-do
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-user-account-settings/what-does-the-available-for-hire-checkbox-do
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/what-does-the-available-for-hire-checkbox-do
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /articles/about-organization-membership
|
||||
- /github/setting-up-and-managing-your-github-user-account/about-organization-membership
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/about-organization-membership
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/about-organization-membership
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -8,6 +8,7 @@ redirect_from:
|
||||
- /articles/accessing-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/accessing-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/accessing-an-organization
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/accessing-an-organization
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -4,6 +4,7 @@ intro: 'If you''re a member of an organization, you can publicize or hide your m
|
||||
redirect_from:
|
||||
- /articles/managing-your-membership-in-organizations
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -9,6 +9,7 @@ topics:
|
||||
redirect_from:
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-scheduled-reminders
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/managing-your-scheduled-reminders
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/managing-your-scheduled-reminders
|
||||
shortTitle: Manage scheduled reminders
|
||||
---
|
||||
## About scheduled reminders for users
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /articles/publicizing-or-hiding-organization-membership
|
||||
- /github/setting-up-and-managing-your-github-user-account/publicizing-or-hiding-organization-membership
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /articles/removing-yourself-from-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/removing-yourself-from-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/removing-yourself-from-an-organization
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/removing-yourself-from-an-organization
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/requesting-organization-approval-for-oauth-apps
|
||||
- /github/setting-up-and-managing-your-github-user-account/requesting-organization-approval-for-oauth-apps
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/requesting-organization-approval-for-oauth-apps
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/requesting-organization-approval-for-oauth-apps
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -7,6 +7,7 @@ redirect_from:
|
||||
- /articles/viewing-peoples-roles-in-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/viewing-peoples-roles-in-an-organization
|
||||
- /github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/viewing-peoples-roles-in-an-organization
|
||||
- /account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/viewing-peoples-roles-in-an-organization
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: Building and testing Node.js or Python
|
||||
shortTitle: Build & test Node.js or Python
|
||||
intro: You can create a continuous integration (CI) workflow to build and test your project. Use the language selector to show examples for your language of choice.
|
||||
redirect_from:
|
||||
- /actions/guides/building-and-testing-nodejs-or-python
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
type: tutorial
|
||||
topics:
|
||||
- CI
|
||||
---
|
||||
|
||||
|
||||
<!-- This article is specially rendered via the pages/ directory -->
|
||||
@@ -11,13 +11,11 @@ versions:
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
type: tutorial
|
||||
hidden: true
|
||||
topics:
|
||||
- CI
|
||||
- Node
|
||||
- JavaScript
|
||||
shortTitle: Build & test Node.js
|
||||
hasExperimentalAlternative: true
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
|
||||
@@ -11,12 +11,10 @@ versions:
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
type: tutorial
|
||||
hidden: true
|
||||
topics:
|
||||
- CI
|
||||
- Python
|
||||
shortTitle: Build & test Python
|
||||
hasExperimentalAlternative: true
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
@@ -246,7 +244,7 @@ steps:
|
||||
- run: pip test
|
||||
```
|
||||
|
||||
By default, the `setup-python` action searches for the dependency file (`requirements.txt` for pip or `Pipfile.lock` for pipenv) in the whole repository. For more information, see "[Caching packages dependencies](https://github.com/actions/setup-python#caching-packages-dependencies)" in the `setup-python` README.
|
||||
By default, the `setup-python` action searches for the dependency file (`requirements.txt` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the whole repository. For more information, see "[Caching packages dependencies](https://github.com/actions/setup-python#caching-packages-dependencies)" in the `setup-python` README.
|
||||
|
||||
If you have a custom requirement or need finer controls for caching, you can use the [`cache` action](https://github.com/marketplace/actions/cache). Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example above, depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip) in the `cache` action repository.
|
||||
|
||||
|
||||
@@ -14,13 +14,14 @@ redirect_from:
|
||||
- /actions/language-and-framework-guides/github-actions-for-java
|
||||
- /actions/language-and-framework-guides/github-actions-for-javascript-and-typescript
|
||||
- /actions/language-and-framework-guides/github-actions-for-python
|
||||
- /actions/guides/building-and-testing-nodejs-or-python
|
||||
- /actions/automating-builds-and-tests/building-and-testing-nodejs-or-python
|
||||
children:
|
||||
- /about-continuous-integration
|
||||
- /building-and-testing-java-with-ant
|
||||
- /building-and-testing-java-with-gradle
|
||||
- /building-and-testing-java-with-maven
|
||||
- /building-and-testing-net
|
||||
- /building-and-testing-nodejs-or-python
|
||||
- /building-and-testing-nodejs
|
||||
- /building-and-testing-powershell
|
||||
- /building-and-testing-python
|
||||
|
||||
@@ -88,6 +88,8 @@ For example, if a workflow defined the `numOctocats` and `octocatEyeColor` input
|
||||
|
||||
**Optional** Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.
|
||||
|
||||
{% data reusables.actions.output-limitations %}
|
||||
|
||||
If you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow. For more information on setting outputs in an action, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/reference/workflow-commands-for-github-actions/#setting-an-output-parameter)."
|
||||
|
||||
### Example: Declaring outputs for Docker container and JavaScript actions
|
||||
@@ -110,6 +112,8 @@ outputs:
|
||||
|
||||
**Optional** `outputs` use the same parameters as `outputs.<output_id>` and `outputs.<output_id>.description` (see "[`outputs` for Docker container and JavaScript actions](#outputs-for-docker-container-and-javascript-actions)"), but also includes the `value` token.
|
||||
|
||||
{% data reusables.actions.output-limitations %}
|
||||
|
||||
### Example: Declaring outputs for composite actions
|
||||
|
||||
{% raw %}
|
||||
@@ -223,7 +227,7 @@ For example, this `cleanup.js` will only run on Linux-based runners:
|
||||
|
||||
### `runs.steps`
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4853 or ghec %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}
|
||||
**Required** The steps that you plan to run in this action. These can be either `run` steps or `uses` steps.
|
||||
{% else %}
|
||||
**Required** The steps that you plan to run in this action.
|
||||
@@ -231,7 +235,7 @@ For example, this `cleanup.js` will only run on Linux-based runners:
|
||||
|
||||
#### `runs.steps[*].run`
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4853 or ghec %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}
|
||||
**Optional** The command you want to run. This can be inline or a script in your action repository:
|
||||
{% else %}
|
||||
**Required** The command you want to run. This can be inline or a script in your action repository:
|
||||
@@ -261,7 +265,7 @@ For more information, see "[`github context`](/actions/reference/context-and-exp
|
||||
|
||||
#### `runs.steps[*].shell`
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4853 or ghec %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}
|
||||
**Optional** The shell where you want to run the command. You can use any of the shells listed [here](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsshell). Required if `run` is set.
|
||||
{% else %}
|
||||
**Required** The shell where you want to run the command. You can use any of the shells listed [here](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsshell). Required if `run` is set.
|
||||
@@ -314,7 +318,7 @@ steps:
|
||||
|
||||
**Optional** Specifies the working directory where the command is run.
|
||||
|
||||
{% ifversion fpt or ghes > 3.2 or ghae-issue-4853 or ghec %}
|
||||
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}
|
||||
#### `runs.steps[*].uses`
|
||||
|
||||
**Optional** Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a [published Docker container image](https://hub.docker.com/).
|
||||
|
||||
@@ -156,7 +156,7 @@ You can also build an app that uses deployment and deployment status webhooks to
|
||||
|
||||
## Choosing a runner
|
||||
|
||||
You can run your deployment workflow on {% data variables.product.company_short %}-hosted runners or on self-hosted runners. Traffic from {% data variables.product.company_short %}-hosted runners can come from a [wide range of network addresses](/rest/reference/meta#get-github-meta-information). If you are deploying to an internal environment and your company restricts external traffic into private networks, {% data variables.product.prodname_actions %} workflows running on {% data variables.product.company_short %}-hosted runners may not be communicate with your internal services or resources. To overcome this, you can host your own runners. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[About GitHub-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
You can run your deployment workflow on {% data variables.product.company_short %}-hosted runners or on self-hosted runners. Traffic from {% data variables.product.company_short %}-hosted runners can come from a [wide range of network addresses](/rest/reference/meta#get-github-meta-information). If you are deploying to an internal environment and your company restricts external traffic into private networks, {% data variables.product.prodname_actions %} workflows running on {% data variables.product.company_short %}-hosted runners may not be able to communicate with your internal services or resources. To overcome this, you can host your own runners. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[About GitHub-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||