2
.github/CODEOWNERS
vendored
@@ -16,9 +16,11 @@ package-lock.json @github/docs-engineering
|
||||
package.json @github/docs-engineering
|
||||
|
||||
# Localization
|
||||
/.github/workflows/create-translation-batch-pr.yml @github/docs-localization
|
||||
/.github/workflows/crowdin.yml @github/docs-localization
|
||||
/crowdin*.yml @github/docs-engineering @github/docs-localization
|
||||
/translations/ @github/docs-engineering @github/docs-localization @github-actions
|
||||
/translations/log/ @github/docs-localization
|
||||
|
||||
# Site Policy
|
||||
/content/github/site-policy/ @github/site-policy-admins
|
||||
|
||||
63
.github/actions-scripts/compress-large-files.js
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import zlib from 'zlib'
|
||||
import walk from 'walk-sync'
|
||||
|
||||
const DRY_RUN = Boolean(JSON.parse(process.env.DRY_RUN || 'false'))
|
||||
// Roughly 100KiB means about 25 files at the moment.
|
||||
// Set this too low and the overheads will be more than the disk and
|
||||
// network I/O that this intends to serve.
|
||||
const MIN_GZIP_SIZE = Number(process.env.MIN_GZIP_SIZE || 1024 * 100)
|
||||
|
||||
const BROTLI_OPTIONS = {
|
||||
params: {
|
||||
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
|
||||
[zlib.constants.BROTLI_PARAM_QUALITY]: 6,
|
||||
},
|
||||
}
|
||||
main()
|
||||
|
||||
async function main() {
|
||||
compressFromPattern('lib/**/static/**/*.json')
|
||||
}
|
||||
|
||||
async function compressFromPattern(pattern) {
|
||||
const glob = pattern.includes('*') ? pattern.split(path.sep).slice(1).join(path.sep) : undefined
|
||||
const walkOptions = {
|
||||
globs: glob ? [glob] : undefined,
|
||||
directories: false,
|
||||
includeBasePath: true,
|
||||
}
|
||||
const root = path.resolve(pattern.includes('*') ? pattern.split(path.sep)[0] : pattern)
|
||||
const filePaths = walk(root, walkOptions).filter((filePath) => {
|
||||
return fs.statSync(filePath).size > MIN_GZIP_SIZE
|
||||
})
|
||||
|
||||
if (!DRY_RUN) {
|
||||
console.time(`Compress ${filePaths.length} files`)
|
||||
const compressed = await Promise.all(filePaths.map(compressFile))
|
||||
console.timeEnd(`Compress ${filePaths.length} files`)
|
||||
|
||||
console.time(`Delete ${compressed.length} files`)
|
||||
compressed.forEach((filePath) => fs.unlinkSync(filePath))
|
||||
console.timeEnd(`Delete ${compressed.length} files`)
|
||||
}
|
||||
}
|
||||
|
||||
function compressFile(filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const contentStream = fs.createReadStream(filePath)
|
||||
const newFilePath = `${filePath}.br`
|
||||
const writeStream = fs.createWriteStream(newFilePath)
|
||||
const compressor = zlib.createBrotliCompress(BROTLI_OPTIONS)
|
||||
contentStream
|
||||
.pipe(compressor)
|
||||
.pipe(writeStream)
|
||||
.on('finish', (err) => {
|
||||
if (err) return reject(err)
|
||||
resolve(filePath)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -12,13 +12,13 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
|
||||
- [ ] Increment the `next` variable above the `supported` array (e.g., new release number + `.1`).
|
||||
- [ ] Increment the `nextNext` variable above the `supported` array (e.g., new release number + `.2`).
|
||||
- [ ] Update the GHES dates file:
|
||||
- [ ] Make sure you have a `.env` file at the root directory of your local checkout, and that it contains a PAT in the format of `GITHUB_TOKEN=<token>`.
|
||||
- [ ] Make sure you have a `.env` file at the root directory of your local checkout, and that it contains a PAT in the format of `GITHUB_TOKEN=<token>` with `repo` scope. Ensure the PAT is SSO-enabled for the `github` org.
|
||||
- [ ] Run the script to update the dates file:
|
||||
|
||||
```
|
||||
script/update-enterprise-dates.js
|
||||
```
|
||||
- [ ] Create REST files based on previous version:
|
||||
- [ ] Create REST files based on previous version. For example `script/enterprise-server-releases/create-rest-files.js --oldVersion enterprise-server@3.2 --newVersion enterprise-server@3.3`:
|
||||
|
||||
```
|
||||
script/enterprise-server-releases/create-rest-files.js --oldVersion <PLAN@RELEASE> --newVersion <PLAN@RELEASE>
|
||||
@@ -33,7 +33,7 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
|
||||
```
|
||||
script/enterprise-server-releases/create-webhook-files.js --oldVersion <PLAN@RELEASE> --newVersion <PLAN@RELEASE>
|
||||
```
|
||||
- [ ] Create a placeholder release notes file called `data/release-notes/<PRODUCT>/<RELEASE NUMBER>/PLACEHOLDER.yml`. For example `data/release-notes/3-1/PLACEHOLDER.yml`. Add the following placeholder content to the file:
|
||||
- [ ] Create a placeholder release notes file called `data/release-notes/<PRODUCT>/<RELEASE NUMBER>/PLACEHOLDER.yml`. For example `data/release-notes/enterprise-server/3-1/PLACEHOLDER.yml`. Add the following placeholder content to the file:
|
||||
|
||||
```
|
||||
date: '2021-05-04'
|
||||
@@ -55,6 +55,8 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
|
||||
script/enterprise-server-releases/release-banner.js --action create --version <PLAN@RELEASE>
|
||||
```
|
||||
|
||||
- [ ] Create a PR with the above changes. This PR is used to track all docs changes and smoke tests associated with the release. For example https://github.com/github/docs-internal/pull/22286.
|
||||
|
||||
### When the `docs-internal` release branch is open
|
||||
|
||||
- [ ] Add a label to the PR in this format:
|
||||
@@ -102,7 +104,7 @@ This file should be automatically updated, but you can also run `script/update-e
|
||||
Usually, we should smoke test any new GHES admin guides, any large features landing in this GHES version for the first time, and the REST and GraphQL API references.
|
||||
- [ ] Alert the Neon Squad (formally docs-ecosystem team) 1-2 days before the release to deploy to `github/github`. A PR should already be open in `github/github`, to change `published` to `true` in `app/api/description/config/releases/ghes-<NEXT RELEASE NUMBER>.yaml`. They will need to:
|
||||
- [ ] Get the required approval from `@github/ecosystem-api-reviewers` then deploy the PR to dotcom. This process generally takes 30-90 minutes.
|
||||
- [ ] Once the PR merges, make sure that the auto-generated PR titled "Update OpenAPI Descriptions" in doc-internal contains both the derefrenced and decorated JSON files for the new GHES release. If everything looks good, merge the "Update OpenAPI Description" PR into the GHES release megabranch.
|
||||
- [ ] Once the PR merges, make sure that the auto-generated PR titled "Update OpenAPI Descriptions" in doc-internal contains both the derefrenced and decorated JSON files for the new GHES release. If everything looks good, merge the "Update OpenAPI Description" PR into the GHES release megabranch. **Note:** Be careful about resolving the conflicts correctly—you may wish to delete the existing OpenAPI files for the release version from the megabranch, so there are no conflicts to resolve and to ensure that the incoming artifacts are the correct ones.
|
||||
- [ ] Add a blocking review to the auto-generated "Update OpenAPI Descriptions" PR in the public REST API description. (Remove this blocking review once the GHES release ships.)
|
||||
- [ ] [Freeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) at least 1-2 days before the release, and post an announcement in Slack so everybody knows.
|
||||
|
||||
@@ -113,8 +115,9 @@ This file should be automatically updated, but you can also run `script/update-e
|
||||
|
||||
Use admin permissions to ship the release branch with this failure. Make sure that the merge's commit title does not include anything like `[DO NOT MERGE]`, and remove all the branch's commit details from the merge's commit message except for the co-author list.
|
||||
- [ ] Do any required smoke tests listed in the opening post in the megabranch PR.
|
||||
- [ ] Push the search index LFS objects for the public `github/docs` repo. The LFS objects were already being pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects, run the [search sync workflow](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml) with the following inputs:
|
||||
- [ ] Once smoke tests have passed, you can [unfreeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) and post an announcement in Slack.
|
||||
- [ ] After unfreezing, push the search index LFS objects for the public `github/docs` repo. The LFS objects were already being pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects, run the [search sync workflow](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml) with the following inputs:
|
||||
version: `enterprise-server@<RELEASE>`
|
||||
language: `en`
|
||||
- [ ] Once smoke tests have passed, you can [unfreeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) and post an announcement in Slack.
|
||||
- [ ] After the release, in the `docs-content` repo, add the now live version number to the "Specific GHES version(s)" section in the following files: [`.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml) and [`.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml). When the PR is approved, merge it in.
|
||||
- [ ] After unfreezing, if there were significant or highlighted GraphQL changes in the release, consider manually running the [GraphQL update workflow](https://github.com/github/docs-internal/actions/workflows/update-graphql-files.yml) to update our GraphQL schemas. By default this workflow only runs once every 24 hours.
|
||||
- [ ] After the release, in the `docs-content` repo, add the now live version number to the "Specific GHES version(s)" section in the following files: [`.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml) and [`.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml). When the PR is approved, merge it in.
|
||||
|
||||
4
.github/allowed-actions.js
vendored
@@ -5,10 +5,10 @@
|
||||
|
||||
export default [
|
||||
'actions/cache@c64c572235d810460d0d6876e9c705ad5002b353', // v2.1.6
|
||||
'actions/checkout@1e204e9a9253d643386038d443f96446fa156a97', // v2.3.5
|
||||
'actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579', // v2.4.0
|
||||
'actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d', // v4.0.2
|
||||
'actions/labeler@5f867a63be70efff62b767459b009290364495eb', // v2.2.0
|
||||
'actions/setup-node@270253e841af726300e85d718a5f606959b2903c', // v2.4.1
|
||||
'actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458', // v2.5.0
|
||||
'actions/stale@cdf15f641adb27a71842045a94023bef6945e3aa', // v4.0.0
|
||||
'actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074', // v2.2.4
|
||||
'alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488', // v0.8.1
|
||||
|
||||
2
.github/workflows/60-days-stale-check.yml
vendored
@@ -23,5 +23,5 @@ jobs:
|
||||
only-labels: 'engineering,Triaged,Improve existing docs,Core,Ecosystem'
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'never-stale'
|
||||
exempt-pr-labels: 'never-stale,waiting for review'
|
||||
exempt-issue-labels: 'never-stale,help wanted,waiting for review'
|
||||
|
||||
4
.github/workflows/autoupdate-branch.yml
vendored
@@ -31,10 +31,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo content
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
20
.github/workflows/browser-test.yml
vendored
@@ -10,6 +10,17 @@ on:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.js'
|
||||
- '**.mjs'
|
||||
- '**.ts'
|
||||
- '**.tsx'
|
||||
- jest.config.js
|
||||
- package.json
|
||||
# In case something like eslint or tsc or prettier upgrades
|
||||
- package-lock.json
|
||||
# Ultimately, for debugging this workflow itself
|
||||
- .github/workflows/browser-test.yml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -18,19 +29,24 @@ jobs:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
lfs: true
|
||||
- name: Checkout LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
# This makes it so the puppeteer npm package doesn't bother
|
||||
# to download a copy of chromium because it can use
|
||||
# `$PUPPETEER_EXECUTABLE_PATH` from the ubuntu Action container.
|
||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
|
||||
run: npm ci --include=optional
|
||||
|
||||
- name: Run browser-test
|
||||
|
||||
2
.github/workflows/build-docker-image.yml
vendored
@@ -30,6 +30,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- name: Build the container
|
||||
run: docker build --target production .
|
||||
|
||||
@@ -22,9 +22,9 @@ jobs:
|
||||
REPORT_REPOSITORY: github/docs-content
|
||||
steps:
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
@@ -36,10 +36,10 @@ jobs:
|
||||
exit 1 # prevents further steps from running
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
2
.github/workflows/codeql.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
|
||||
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
PR-Preview-Links:
|
||||
if: github.event.pull_request.user.login != 'Octomerger'
|
||||
name: Add staging/live links to PR
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
@@ -38,10 +39,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check out repo content
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
@@ -25,14 +25,22 @@ jobs:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
include:
|
||||
- language: pt-BR
|
||||
language_code: pt
|
||||
- language: zh-CN
|
||||
language_code: cn
|
||||
- language: ja-JP
|
||||
language_code: ja
|
||||
- language: es-ES
|
||||
language_code: es
|
||||
- language: pt
|
||||
crowdin_language: pt-BR
|
||||
language_dir: translations/pt-BR
|
||||
|
||||
- language: es
|
||||
crowdin_language: es-ES
|
||||
language_dir: translations/es-ES
|
||||
|
||||
- language: cn
|
||||
crowdin_language: zh-CN
|
||||
language_dir: translations/zh-CN
|
||||
|
||||
- language_dir: translations/ja-JP
|
||||
crowdin_language: ja
|
||||
language: ja
|
||||
|
||||
steps:
|
||||
- name: Set branch name
|
||||
id: set-branch
|
||||
@@ -43,7 +51,7 @@ jobs:
|
||||
- run: git config --global user.email "67483024+docubot@users.noreply.github.com"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -72,11 +80,11 @@ jobs:
|
||||
|
||||
- name: Remove all language translations
|
||||
run: |
|
||||
git rm -rf --quiet translations/${{ matrix.language }}/content
|
||||
git rm -rf --quiet translations/${{ matrix.language }}/data
|
||||
git rm -rf --quiet ${{ matrix.language_dir }}/content
|
||||
git rm -rf --quiet ${{ matrix.language_dir }}/data
|
||||
|
||||
- name: Download crowdin translations
|
||||
run: crowdin download --no-progress --no-colors --verbose --debug '--branch=main' '--config=crowdin.yml' --language=${{ matrix.language }}
|
||||
run: crowdin download --no-progress --no-colors --verbose --debug '--branch=main' '--config=crowdin.yml' --language=${{ matrix.crowdin_language }}
|
||||
env:
|
||||
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
|
||||
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api
|
||||
@@ -89,11 +97,11 @@ jobs:
|
||||
|
||||
- name: Commit crowdin sync
|
||||
run: |
|
||||
git add translations/${{ matrix.language }}
|
||||
git add ${{ matrix.language_dir }}
|
||||
git commit -m "Add crowdin translations" || echo "Nothing to commit"
|
||||
|
||||
- name: 'Setup node'
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
@@ -103,44 +111,44 @@ jobs:
|
||||
- name: Homogenize frontmatter
|
||||
run: |
|
||||
node script/i18n/homogenize-frontmatter.js
|
||||
git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/homogenize-frontmatter.js" || echo "Nothing to commit"
|
||||
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 translations/${{ matrix.language }} && git commit -m "Run script/i18n/fix-translation-errors.js" || echo "Nothing to commit"
|
||||
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 translations/${{ matrix.language }} && git commit -m "Run script/i18n/lint-translation-files.js --check parsing" || echo "Nothing to commit"
|
||||
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 translations/${{ matrix.language }} && git commit -m "Run script/i18n/lint-translation-files.js --check rendering" || echo "Nothing to commit"
|
||||
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_code }} | tee -a /tmp/batch.log | cat
|
||||
git add translations/${{ matrix.language }} && git commit -m "run script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language_code }}" || echo "Nothing to commit"
|
||||
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 translations/${{ matrix.language }} && git commit -m "run script/i18n/reset-known-broken-translation-files.js" || echo "Nothing to commit"
|
||||
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_code }}-resets.csv
|
||||
script/i18n/report-reset-files.js --report-type=csv --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > $csvFile
|
||||
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: Create Pull Request
|
||||
@@ -149,7 +157,7 @@ jobs:
|
||||
# We'll try to create the pull request based on the changes we pushed up in the branch.
|
||||
# If there are actually no differences between the branch and `main`, we'll delete it.
|
||||
run: |
|
||||
script/i18n/report-reset-files.js --report-type=pull-request-body --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > /tmp/pr-body.txt
|
||||
script/i18n/report-reset-files.js --report-type=pull-request-body --language=${{ matrix.language }} --log-file=/tmp/batch.log > /tmp/pr-body.txt
|
||||
git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
gh pr create --title "New translation batch for ${{ matrix.language }}" \
|
||||
--base=main \
|
||||
|
||||
4
.github/workflows/crowdin-cleanup.yml
vendored
@@ -18,10 +18,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
2
.github/workflows/crowdin.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
timeout-minutes: 300
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
|
||||
4
.github/workflows/docs-review-collect.yml
vendored
@@ -20,10 +20,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repo content
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/enterprise-dates.yml
vendored
@@ -32,10 +32,10 @@ jobs:
|
||||
exit 1 # prevents further steps from running
|
||||
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
@@ -36,13 +36,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
token: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
)
|
||||
const logins = teamMembers.data.map(member => member.login)
|
||||
// ignore PRs opened by docs bot accounts
|
||||
logins.push('Octomerger', 'octoglot')
|
||||
logins.push('Octomerger', 'octoglot', 'docubot')
|
||||
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
|
||||
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
|
||||
return 'true'
|
||||
|
||||
4
.github/workflows/js-lint.yml
vendored
@@ -25,10 +25,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/link-check-dotcom.yml
vendored
@@ -18,10 +18,10 @@ jobs:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/link-check-ghae.yml
vendored
@@ -18,10 +18,10 @@ jobs:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/link-check-ghec.yml
vendored
@@ -16,10 +16,10 @@ jobs:
|
||||
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/link-check-ghes.yml
vendored
@@ -18,10 +18,10 @@ jobs:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/open-enterprise-issue.yml
vendored
@@ -16,10 +16,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/openapi-decorate.yml
vendored
@@ -26,10 +26,10 @@ jobs:
|
||||
add-labels: 'github-openapi-bot'
|
||||
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/openapi-schema-check.yml
vendored
@@ -29,10 +29,10 @@ jobs:
|
||||
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/os-ready-for-review.yml
vendored
@@ -44,10 +44,10 @@ jobs:
|
||||
exit 1
|
||||
|
||||
- name: Check out repo content
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/pa11y.yml
vendored
@@ -14,10 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/package-lock-lint.yml
vendored
@@ -19,10 +19,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
|
||||
4
.github/workflows/ping-staging-apps.yml
vendored
@@ -16,9 +16,9 @@ jobs:
|
||||
env:
|
||||
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/prod-build-deploy.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
persist-credentials: 'false'
|
||||
lfs: 'true'
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/ready-for-doc-review.yml
vendored
@@ -15,10 +15,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo content
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
@@ -24,10 +24,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
@@ -46,10 +46,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/remove-unused-assets.yml
vendored
@@ -22,9 +22,9 @@ jobs:
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/repo-sync.yml
vendored
@@ -94,11 +94,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
# Set up npm and run npm ci to run husky to get githooks for LFS
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
7
.github/workflows/site-policy-sync.yml
vendored
@@ -26,10 +26,10 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: checkout docs-internal
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: checkout public site-policy
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
repository: github/site-policy
|
||||
token: ${{ secrets.API_TOKEN_SITEPOLICY }}
|
||||
@@ -37,6 +37,8 @@ jobs:
|
||||
path: public-repo
|
||||
|
||||
- name: Commits internal policies to copy of public repo with descriptive message from triggering PR title
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
cd public-repo
|
||||
git config --local user.name 'site-policy-bot'
|
||||
@@ -46,7 +48,6 @@ jobs:
|
||||
git status
|
||||
git checkout -b automated-sync-$GITHUB_RUN_ID
|
||||
git add .
|
||||
PR_TITLE=${{ github.event.pull_request.title }}
|
||||
echo PR_TITLE: $PR_TITLE
|
||||
[[ ! -z $PR_TITLE ]] && DESCRIPTION="${PR_TITLE}" || DESCRIPTION="Update manually triggered by workflow"
|
||||
echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_ENV
|
||||
|
||||
45
.github/workflows/staging-build-pr.yml
vendored
@@ -30,15 +30,6 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
debug:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dump full context for debugging
|
||||
run: |
|
||||
cat << EOF
|
||||
${{ toJSON(github) }}
|
||||
EOF
|
||||
|
||||
build-pr:
|
||||
if: ${{ github.repository == 'github/docs-internal' || github.repository == 'github/docs' }}
|
||||
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
|
||||
@@ -50,7 +41,7 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
# Make sure only approved files are changed if it's in github/docs
|
||||
- name: Check changed files
|
||||
@@ -86,7 +77,7 @@ jobs:
|
||||
run: exit 1
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
@@ -117,11 +108,43 @@ jobs:
|
||||
run: npm set-script heroku-postbuild "echo 'Application was pre-built!'"
|
||||
|
||||
- name: Delete heavy things we won't need deployed
|
||||
if: ${{ github.repository == 'github/docs-internal' }}
|
||||
run: |
|
||||
|
||||
# The dereferenced file is not used in runtime once the
|
||||
# decorated file has been created from it.
|
||||
rm -fr lib/rest/static/dereferenced
|
||||
|
||||
# Translations are never tested in Staging builds
|
||||
# but let's keep the empty directory.
|
||||
rm -fr translations
|
||||
mkdir translations
|
||||
|
||||
# Delete all the big search indexes that are NOT English (`*-en-*`)
|
||||
pushd lib/search/indexes
|
||||
ls | grep -v '\-en\-' | xargs rm
|
||||
popd
|
||||
|
||||
# Note! Some day it would be nice to be able to delete
|
||||
# all the heavy assets because they bloat the tarball.
|
||||
# But it's not obvious how to test it then. For now, we'll have
|
||||
# to accept that every staging build has a copy of the images.
|
||||
|
||||
# The assumption here is that a staging build will not
|
||||
# need these legacy redirects. Only the redirects from
|
||||
# front-matter will be at play.
|
||||
# These static redirects json files are notoriously large
|
||||
# and they make the tarball unnecessarily large.
|
||||
echo '[]' > lib/redirects/static/archived-frontmatter-fallbacks.json
|
||||
echo '{}' > lib/redirects/static/developer.json
|
||||
echo '{}' > lib/redirects/static/archived-redirects-from-213-to-217.json
|
||||
|
||||
# This will turn every `lib/**/static/*.json` into
|
||||
# an equivalent `lib/**/static/*.json.br` file.
|
||||
# Once the server starts, it'll know to fall back to reading
|
||||
# the `.br` equivalent if the `.json` file isn't present.
|
||||
node .github/actions-scripts/compress-large-files.js
|
||||
|
||||
- name: Create an archive
|
||||
# Only bother if this is actually a pull request
|
||||
if: ${{ github.event.pull_request.number }}
|
||||
|
||||
8
.github/workflows/staging-deploy-pr.yml
vendored
@@ -293,7 +293,7 @@ jobs:
|
||||
})
|
||||
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
# To prevent issues with cloning early access content later
|
||||
persist-credentials: 'false'
|
||||
@@ -303,7 +303,7 @@ jobs:
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
@@ -475,10 +475,10 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/staging-undeploy-pr.yml
vendored
@@ -55,13 +55,13 @@ jobs:
|
||||
add-labels: 'automated-block-deploy'
|
||||
|
||||
- name: Check out repo's default branch
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
# For enhanced security: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
||||
persist-credentials: 'false'
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/sync-search-indices.yml
vendored
@@ -48,12 +48,12 @@ jobs:
|
||||
exit 1 # prevents further steps from running
|
||||
# Check out internal docs repository
|
||||
- name: checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
token: ${{ secrets.DOCS_BOT_FR }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/test-windows.yml
vendored
@@ -36,13 +36,13 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
11
.github/workflows/test.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
@@ -56,10 +56,13 @@ jobs:
|
||||
|
||||
- name: Insight into changed files
|
||||
run: |
|
||||
echo ${{ steps.get_diff_files.outputs.files }}
|
||||
|
||||
# Must to do this because the list of files can be HUGE. Especially
|
||||
# in a repo-sync when there are lots of translation files involved.
|
||||
echo "${{ steps.get_diff_files.outputs.files }}" > get_diff_files.txt
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
@@ -80,5 +83,5 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
DIFF_FILES: ${{ steps.get_diff_files.outputs.files }}
|
||||
DIFF_FILE: get_diff_files.txt
|
||||
run: npm run test tests/${{ matrix.test-group }}/
|
||||
|
||||
10
.github/workflows/triage-stale-check.yml
vendored
@@ -7,6 +7,10 @@ name: Public Repo Stale Check
|
||||
on:
|
||||
schedule:
|
||||
- cron: '45 16 * * *' # Run each day at 16:45 UTC / 8:45 PST
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale_contributor:
|
||||
@@ -17,11 +21,15 @@ jobs:
|
||||
- uses: actions/stale@cdf15f641adb27a71842045a94023bef6945e3aa
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'A stale label has been added to this issue becuase it has been open for 60 days with no activity. To keep this issue open, add a comment within 3 days.'
|
||||
days-before-issue-stale: 60
|
||||
days-before-issue-close: 3
|
||||
exempt-issue-labels: 'help wanted,waiting for review'
|
||||
stale-pr-message: 'A stale label has been added to this pull request because it has been open 7 days with no activity. To keep this PR open, add a comment or push a commit within 3 days.'
|
||||
days-before-pr-stale: 7
|
||||
days-before-pr-close: 3
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'waiting for review,never-stale, ready to merge'
|
||||
exempt-pr-labels: 'waiting for review,never-stale,ready to merge'
|
||||
stale_staff:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -54,13 +54,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
token: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
4
.github/workflows/update-graphql-files.yml
vendored
@@ -28,9 +28,9 @@ jobs:
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
2
.github/workflows/workflow-lint.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
|
||||
- name: Run linter
|
||||
uses: cschleiden/actions-linter@caffd707beda4fc6083926a3dff48444bc7c24aa
|
||||
|
||||
37
.github/workflows/yml-lint.yml
vendored
@@ -1,37 +0,0 @@
|
||||
name: Lint Yaml
|
||||
|
||||
# **What it does**: This lints our yaml files in the docs repository.
|
||||
# **Why we have it**: We want some level of consistent formatting for YAML files.
|
||||
# **Who does it impact**: Docs engineering, docs content.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**/*.yml'
|
||||
- '**/*.yaml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/*.yml'
|
||||
- '**/*.yaml'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
||||
with:
|
||||
node-version: 16.13.x
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npx prettier -c "**/*.{yml,yaml}"
|
||||
BIN
assets/images/help/codespaces/install-custom-dotfiles.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 16 KiB |
BIN
assets/images/help/codespaces/select-dotfiles-repo.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
assets/images/help/codespaces/setting-default-timeout.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 71 KiB |
BIN
assets/images/help/repository/allow-disable-forking-fpt.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
assets/images/help/support/request-callback.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -1,14 +1,12 @@
|
||||
/* TODO remove mark styling if https://github.com/primer/css/pull/1756 ships */
|
||||
.resultsContainer mark {
|
||||
font-weight: bolder;
|
||||
background: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.searchResultContent mark {
|
||||
color: var(--color-fg-default);
|
||||
background-color: var(--color-attention-subtle);
|
||||
font-weight: bolder;
|
||||
}
|
||||
/* end TODO */
|
||||
|
||||
.searchResultContent {
|
||||
max-height: 4rem;
|
||||
|
||||
@@ -436,7 +436,7 @@ function ShowSearchResults({
|
||||
onClickOutside={() => closeSearch()}
|
||||
aria-labelledby="title"
|
||||
sx={
|
||||
isHeaderSearch && {
|
||||
(isHeaderSearch && {
|
||||
background: 'none',
|
||||
boxShadow: 'none',
|
||||
position: 'static',
|
||||
@@ -445,7 +445,8 @@ function ShowSearchResults({
|
||||
maxWidth: '96%',
|
||||
margin: '1.5em 2em 0 0.5em',
|
||||
scrollbarWidth: 'none',
|
||||
}
|
||||
}) ||
|
||||
{}
|
||||
}
|
||||
>
|
||||
{ActionListResults}
|
||||
|
||||
@@ -69,7 +69,7 @@ export const ArticlePage = () => {
|
||||
className={item.platform}
|
||||
sx={{ listStyle: 'none', padding: '2px' }}
|
||||
>
|
||||
<div className={cx('lh-condensed')}>
|
||||
<div className={cx('lh-condensed d-block width-full')}>
|
||||
<div dangerouslySetInnerHTML={{ __html: item.contents }} />
|
||||
{item.items && item.items.length > 0 ? (
|
||||
<ul className="ml-3">{item.items.map(renderTocItem)}</ul>
|
||||
|
||||
@@ -17,7 +17,7 @@ export type ArticleGuide = {
|
||||
topics: Array<string>
|
||||
}
|
||||
|
||||
export type ProductSubLandingContextT = {
|
||||
export type ProductGuidesContextT = {
|
||||
title: string
|
||||
intro: string
|
||||
featuredTrack?: FeaturedTrack
|
||||
@@ -26,21 +26,21 @@ export type ProductSubLandingContextT = {
|
||||
allTopics?: Array<string>
|
||||
}
|
||||
|
||||
export const ProductSubLandingContext = createContext<ProductSubLandingContextT | null>(null)
|
||||
export const ProductGuidesContext = createContext<ProductGuidesContextT | null>(null)
|
||||
|
||||
export const useProductSubLandingContext = (): ProductSubLandingContextT => {
|
||||
const context = useContext(ProductSubLandingContext)
|
||||
export const useProductGuidesContext = (): ProductGuidesContextT => {
|
||||
const context = useContext(ProductGuidesContext)
|
||||
|
||||
if (!context) {
|
||||
throw new Error(
|
||||
'"useProductSubLandingContext" may only be used inside "ProductSubLandingContext.Provider"'
|
||||
'"useProductGuidesContext" may only be used inside "ProductGuidesContext.Provider"'
|
||||
)
|
||||
}
|
||||
|
||||
return context
|
||||
}
|
||||
|
||||
export const getProductSubLandingContextFromRequest = (req: any): ProductSubLandingContextT => {
|
||||
export const getProductGuidesContextFromRequest = (req: any): ProductGuidesContextT => {
|
||||
const page = req.context.page
|
||||
|
||||
return {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ArticleGuide } from 'components/context/ProductSubLandingContext'
|
||||
import { ArticleGuide } from 'components/context/ProductGuidesContext'
|
||||
import { Label } from '@primer/components'
|
||||
|
||||
type Props = {
|
||||
108
components/guides/ArticleCards.tsx
Normal file
@@ -0,0 +1,108 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
ArticleGuide,
|
||||
useProductGuidesContext,
|
||||
} from 'components/context/ProductGuidesContext'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
import { ArticleCard } from './ArticleCard'
|
||||
import { DropdownMenu } from '@primer/components'
|
||||
import { ItemInput } from '@primer/components/lib/ActionList/List'
|
||||
|
||||
const PAGE_SIZE = 9
|
||||
export const ArticleCards = () => {
|
||||
const { t } = useTranslation('product_guides')
|
||||
const guideTypes: Record<string, string> = t('guide_types')
|
||||
const { allTopics, includeGuides } = useProductGuidesContext()
|
||||
const [numVisible, setNumVisible] = useState(PAGE_SIZE)
|
||||
const [typeFilter, setTypeFilter] = useState<ItemInput | undefined>()
|
||||
const [topicFilter, setTopicFilter] = useState<ItemInput | undefined>()
|
||||
const [filteredResults, setFilteredResults] = useState<Array<ArticleGuide>>([])
|
||||
|
||||
useEffect(() => {
|
||||
setNumVisible(PAGE_SIZE)
|
||||
setFilteredResults(
|
||||
(includeGuides || []).filter((card) => {
|
||||
const matchesType = card.type === typeFilter?.key
|
||||
const matchesTopic = card.topics.some((key) => key === topicFilter?.key)
|
||||
return (typeFilter?.key ? matchesType : true) && (topicFilter?.key ? matchesTopic : true)
|
||||
})
|
||||
)
|
||||
}, [typeFilter, topicFilter])
|
||||
|
||||
const isUserFiltering = typeFilter !== undefined || topicFilter !== undefined
|
||||
|
||||
const guides = isUserFiltering ? filteredResults : includeGuides || []
|
||||
|
||||
const types = Object.entries(guideTypes).map(([key, val]) => {
|
||||
return (
|
||||
{text: val, key: key}
|
||||
)
|
||||
}) as ItemInput[]
|
||||
|
||||
types.unshift({text: t('filters.all'), key: undefined})
|
||||
|
||||
const topics = allTopics?.map((topic) => {
|
||||
return (
|
||||
{text: topic, key: topic}
|
||||
)
|
||||
}) as ItemInput[]
|
||||
|
||||
topics.unshift({text: t('filters.all'), key: undefined})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<label htmlFor="guide-filter-form">{t('filter_instructions')}</label>
|
||||
<form name="guide-filter-form" className="mt-2 mb-5 d-flex d-flex">
|
||||
<div data-testid="card-filter-types">
|
||||
<label htmlFor="type" className="text-uppercase f6 color-fg-muted d-block">
|
||||
{t('filters.type')}
|
||||
</label>
|
||||
<DropdownMenu
|
||||
aria-label="guide types"
|
||||
data-testid="types-dropdown"
|
||||
placeholder={t('filters.all')}
|
||||
items={types}
|
||||
selectedItem={typeFilter}
|
||||
onChange={setTypeFilter} />
|
||||
</div>
|
||||
|
||||
<div data-testid="card-filter-topics" className="mx-4">
|
||||
<label htmlFor="topic" className="text-uppercase f6 color-fg-muted d-block">
|
||||
{t('filters.topic')}
|
||||
</label>
|
||||
<DropdownMenu
|
||||
aria-label="guide topics"
|
||||
data-testid="topics-dropdown"
|
||||
placeholder={t('filters.all')}
|
||||
items={topics}
|
||||
selectedItem={topicFilter}
|
||||
onChange={setTopicFilter} />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div role="status" className="color-fg-muted">
|
||||
{guides.length === 0
|
||||
? t('guides_found.none')
|
||||
: guides.length === 1
|
||||
? t('guides_found.one')
|
||||
: t('guides_found.multiple').replace('{n}', guides.length)}
|
||||
</div>
|
||||
|
||||
<div className="d-flex flex-wrap mr-0 mr-md-n6 mr-lg-n8">
|
||||
{guides.slice(0, numVisible).map((card) => {
|
||||
return <ArticleCard key={card.href} card={card} typeLabel={guideTypes[card.type]} />
|
||||
})}
|
||||
</div>
|
||||
|
||||
{guides.length > numVisible && (
|
||||
<button
|
||||
className="col-12 mt-5 text-center text-bold color-fg-accent btn-link"
|
||||
onClick={() => setNumVisible(numVisible + PAGE_SIZE)}
|
||||
>
|
||||
{t('load_more')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
import cx from 'classnames'
|
||||
import { useProductSubLandingContext } from 'components/context/ProductSubLandingContext'
|
||||
import { useProductGuidesContext } from 'components/context/ProductGuidesContext'
|
||||
import { ArrowRightIcon, StarFillIcon } from '@primer/octicons-react'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
import { Link } from 'components/Link'
|
||||
import { TruncateLines } from 'components/ui/TruncateLines'
|
||||
import { Lead } from 'components/ui/Lead'
|
||||
import styles from './SubLandingHero.module.scss'
|
||||
import styles from './GuidesHero.module.scss'
|
||||
|
||||
export const SubLandingHero = () => {
|
||||
const { title, intro, featuredTrack } = useProductSubLandingContext()
|
||||
const { t } = useTranslation('product_sublanding')
|
||||
export const GuidesHero = () => {
|
||||
const { title, intro, featuredTrack } = useProductGuidesContext()
|
||||
const { t } = useTranslation('product_guides')
|
||||
const cardWidth = 280
|
||||
|
||||
const guideItems = featuredTrack?.guides?.map((guide) => (
|
||||
@@ -1,8 +1,9 @@
|
||||
import cx from 'classnames'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
import { ArrowRightIcon } from '@primer/octicons-react'
|
||||
import { ActionList } from '@primer/components'
|
||||
import { useState } from 'react'
|
||||
import { FeaturedTrack } from 'components/context/ProductSubLandingContext'
|
||||
import { FeaturedTrack } from 'components/context/ProductGuidesContext'
|
||||
import { TruncateLines } from 'components/ui/TruncateLines'
|
||||
import slugger from 'github-slugger'
|
||||
import styles from './LearningTrack.module.scss'
|
||||
@@ -17,7 +18,7 @@ export const LearningTrack = ({ track }: Props) => {
|
||||
const showAll = () => {
|
||||
setNumVisible(track?.guides?.length || 0)
|
||||
}
|
||||
const { t } = useTranslation('product_sublanding')
|
||||
const { t } = useTranslation('product_guides')
|
||||
const slug = track?.title ? slugger.slug(track?.title) : ''
|
||||
|
||||
return (
|
||||
@@ -48,30 +49,57 @@ export const LearningTrack = ({ track }: Props) => {
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{track?.guides?.slice(0, numVisible).map((guide) => (
|
||||
<div key={guide.href + track?.trackName}>
|
||||
<a
|
||||
className="Box-row d-flex flex-items-center color-fg-default no-underline"
|
||||
href={`${guide.href}?learn=${track?.trackName}&learnProduct=${track?.trackProduct}`}
|
||||
>
|
||||
<div
|
||||
className="color-bg-subtle d-inline-flex mr-4 circle flex-items-center flex-justify-center"
|
||||
style={{ width: 32, height: 32 }}
|
||||
>
|
||||
{track?.guides && (
|
||||
<span className="m-2 f3 lh-condensed-ultra text-center text-bold step-circle-text">
|
||||
{track.guides?.indexOf(guide) + 1}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<h5 className="flex-auto pr-2" dangerouslySetInnerHTML={{ __html: guide.title }} />
|
||||
<div className="color-fg-muted h6 text-uppercase flex-shrink-0">
|
||||
{t('guide_types')[guide.page?.type || '']}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{track && track.guides && (
|
||||
<ActionList
|
||||
{...{ as: 'ul' }}
|
||||
items={track?.guides?.slice(0, numVisible).map((guide) => {
|
||||
return {
|
||||
renderItem: () => (
|
||||
<ActionList.Item
|
||||
as="li"
|
||||
key={guide.href + track?.trackName}
|
||||
sx={{
|
||||
borderRadius: 0,
|
||||
padding: 0,
|
||||
':hover': {
|
||||
borderRadius: 0,
|
||||
},
|
||||
':last-of-type': {
|
||||
marginBottom: '-8px',
|
||||
},
|
||||
':first-of-type': {
|
||||
marginTop: '-8px',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<a
|
||||
className="rounded-0 width-full d-block Box-row d-flex flex-items-center color-fg-default no-underline"
|
||||
href={`${guide.href}?learn=${track?.trackName}&learnProduct=${track?.trackProduct}`}
|
||||
>
|
||||
<div
|
||||
className="color-bg-subtle d-inline-flex mr-4 circle flex-items-center flex-justify-center"
|
||||
style={{ width: 32, height: 32 }}
|
||||
>
|
||||
{track?.guides && (
|
||||
<span className="m-2 f3 lh-condensed-ultra text-center text-bold step-circle-text">
|
||||
{track.guides?.indexOf(guide) + 1}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<h5
|
||||
className="flex-auto pr-2"
|
||||
dangerouslySetInnerHTML={{ __html: guide.title }}
|
||||
/>
|
||||
<div className="color-fg-muted h6 text-uppercase flex-shrink-0">
|
||||
{t('guide_types')[guide.page?.type || '']}
|
||||
</div>
|
||||
</a>
|
||||
</ActionList.Item>
|
||||
),
|
||||
}
|
||||
})}
|
||||
></ActionList>
|
||||
)}
|
||||
{(track?.guides?.length || 0) > numVisible ? (
|
||||
<button
|
||||
className="Box-footer btn-link border-top-0 position-relative text-center text-bold color-fg-accent pt-1 pb-3 col-12"
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useProductSubLandingContext } from 'components/context/ProductSubLandingContext'
|
||||
import { LearningTrack } from 'components/sublanding/LearningTrack'
|
||||
import { useProductGuidesContext } from 'components/context/ProductGuidesContext'
|
||||
import { LearningTrack } from 'components/guides/LearningTrack'
|
||||
|
||||
export const LearningTracks = () => {
|
||||
const { learningTracks } = useProductSubLandingContext()
|
||||
const { learningTracks } = useProductGuidesContext()
|
||||
|
||||
return (
|
||||
<div className="d-flex flex-wrap flex-items-start my-5 gutter">
|
||||
@@ -1,19 +1,19 @@
|
||||
import { DefaultLayout } from 'components/DefaultLayout'
|
||||
import { useProductSubLandingContext } from 'components/context/ProductSubLandingContext'
|
||||
import { useProductGuidesContext } from 'components/context/ProductGuidesContext'
|
||||
import React from 'react'
|
||||
import { LandingSection } from 'components/landing/LandingSection'
|
||||
import { SubLandingHero } from 'components/sublanding/SubLandingHero'
|
||||
import { LearningTracks } from 'components/sublanding/LearningTracks'
|
||||
import { ArticleCards } from 'components/sublanding/ArticleCards'
|
||||
import { GuidesHero } from 'components/guides/GuidesHero'
|
||||
import { LearningTracks } from 'components/guides/LearningTracks'
|
||||
import { ArticleCards } from 'components/guides/ArticleCards'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
|
||||
export const ProductSubLanding = () => {
|
||||
const { title, learningTracks, includeGuides } = useProductSubLandingContext()
|
||||
export const ProductGuides = () => {
|
||||
const { title, learningTracks, includeGuides } = useProductGuidesContext()
|
||||
const { t } = useTranslation('sub_landing')
|
||||
return (
|
||||
<DefaultLayout>
|
||||
<LandingSection className="pt-3">
|
||||
<SubLandingHero />
|
||||
<GuidesHero />
|
||||
</LandingSection>
|
||||
|
||||
{learningTracks && learningTracks.length > 0 && (
|
||||
32
components/homepage/HomePageHero.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Search } from 'components/Search'
|
||||
import { OctocatHeader } from 'components/landing/OctocatHeader'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
|
||||
export const HomePageHero = () => {
|
||||
const { t } = useTranslation(['search'])
|
||||
|
||||
return (
|
||||
<section id="landing" className="color-bg-subtle p-6">
|
||||
{/* eslint-disable-next-line jsx-a11y/no-autofocus */}
|
||||
<Search iconSize={24} variant="expanded">
|
||||
{({ SearchInput, SearchResults }) => {
|
||||
return (
|
||||
<div className="container-xl">
|
||||
<div className="gutter gutter-xl-spacious d-lg-flex flex-row-reverse flex-items-center">
|
||||
<div className="col-lg-7">
|
||||
<OctocatHeader />
|
||||
</div>
|
||||
<div className="col-lg-5">
|
||||
<h1 className="text-semibold">{t('search:need_help')}</h1>
|
||||
{SearchInput}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>{SearchResults}</div>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
</Search>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
86
components/homepage/ProductSelectionCard.tsx
Normal file
@@ -0,0 +1,86 @@
|
||||
import { ProductT, ProductGroupT, useMainContext } from 'components/context/MainContext'
|
||||
|
||||
import React from 'react'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useVersion } from 'components/hooks/useVersion'
|
||||
import { Link } from 'components/Link'
|
||||
import * as Octicons from '@primer/octicons-react'
|
||||
|
||||
type ProductSelectionCardProps = {
|
||||
name: string
|
||||
group: ProductGroupT
|
||||
}
|
||||
|
||||
export const ProductSelectionCard = ({ name, group }: ProductSelectionCardProps) => {
|
||||
const router = useRouter()
|
||||
const { currentVersion } = useVersion()
|
||||
const { isFPT } = useMainContext()
|
||||
|
||||
function href(product: ProductT) {
|
||||
return `${!product.external ? `/${router.locale}` : ''}${
|
||||
product.versions?.includes(currentVersion) && !isFPT
|
||||
? `/${currentVersion}/${product.id}`
|
||||
: product.href
|
||||
}`
|
||||
}
|
||||
|
||||
const groupIcon = {
|
||||
height: '22px',
|
||||
}
|
||||
|
||||
function showProduct(product: ProductT) {
|
||||
return isFPT || product.versions?.includes(currentVersion) || product.external
|
||||
}
|
||||
|
||||
function icon(group: ProductGroupT) {
|
||||
if (group.icon) {
|
||||
return (
|
||||
<div className="pr-3">
|
||||
<img src={group.icon} alt={group.name} style={groupIcon}></img>
|
||||
</div>
|
||||
)
|
||||
} else if (group.octicon) {
|
||||
const octicon: React.FunctionComponent = (
|
||||
Octicons as { [name: string]: React.FunctionComponent }
|
||||
)[group.octicon] as React.FunctionComponent
|
||||
|
||||
return (
|
||||
<div className="mr-2">
|
||||
{React.createElement(octicon, groupIcon as React.Attributes, null)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="d-flex flex-column col-12 col-sm-6 col-lg-4 pb-4">
|
||||
<div className="flex-auto ws-normal">
|
||||
<div className="d-flex flex-items-center">
|
||||
{icon(group)}
|
||||
|
||||
<div>
|
||||
<h3>{name}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="pt-2 mb-4 text-normal">
|
||||
<ul className="list-style-none">
|
||||
{group.children.map((product) => {
|
||||
if (!showProduct(product)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<li key={product.name} className="pt-2">
|
||||
<Link href={href(product)} target={product.external ? '_blank' : undefined}>
|
||||
{product.name}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
20
components/homepage/ProductSelections.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useMainContext } from 'components/context/MainContext'
|
||||
|
||||
import React from 'react'
|
||||
import { ProductSelectionCard } from './ProductSelectionCard'
|
||||
|
||||
export const ProductSelections = () => {
|
||||
const { productGroups } = useMainContext()
|
||||
|
||||
return (
|
||||
<section className="container-xl pb-lg-4 mt-6 px-3 px-md-6" data-testid="product">
|
||||
<div className="">
|
||||
<div className="d-flex flex-wrap gutter gutter-xl-spacious">
|
||||
{productGroups.map((group) => {
|
||||
return <ProductSelectionCard key={group.name} name={group.name} group={group} />
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import cx from 'classnames'
|
||||
import dayjs from 'dayjs'
|
||||
import { ActionList } from '@primer/components'
|
||||
|
||||
import { Link } from 'components/Link'
|
||||
import { ArrowRightIcon } from '@primer/octicons-react'
|
||||
@@ -27,45 +28,59 @@ export const ArticleList = ({ title, viewAllHref, articles }: ArticleListPropsT)
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ul className="list-style-none" data-testid="article-list">
|
||||
{articles.map((link) => {
|
||||
return (
|
||||
<li key={link.href} className={cx('border-top')}>
|
||||
<BumpLink
|
||||
as={Link}
|
||||
href={link.href}
|
||||
className="py-3"
|
||||
title={
|
||||
<h4 data-testid="link-with-intro-title">
|
||||
<span
|
||||
dangerouslySetInnerHTML={
|
||||
link.fullTitle ? { __html: link.fullTitle } : { __html: link.title }
|
||||
}
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
<ActionList
|
||||
{...{ as: 'ul' }}
|
||||
data-testid="article-list"
|
||||
items={articles.map((link) => {
|
||||
return {
|
||||
renderItem: () => (
|
||||
<ActionList.Item
|
||||
as="li"
|
||||
key={link.href}
|
||||
className={cx('border-top')}
|
||||
sx={{
|
||||
borderRadius: 0,
|
||||
':hover': {
|
||||
borderRadius: 0,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{!link.hideIntro && link.intro && (
|
||||
<TruncateLines as="p" maxLines={2} className="color-fg-muted mb-0 mt-1">
|
||||
<span
|
||||
data-testid="link-with-intro-intro"
|
||||
dangerouslySetInnerHTML={{ __html: link.intro }}
|
||||
/>
|
||||
</TruncateLines>
|
||||
)}
|
||||
{link.date && (
|
||||
<time
|
||||
className="tooltipped tooltipped-n color-fg-muted text-mono mt-1"
|
||||
aria-label={dayjs(link.date).format('LLL')}
|
||||
>
|
||||
{dayjs(link.date).format('MMMM DD')}
|
||||
</time>
|
||||
)}
|
||||
</BumpLink>
|
||||
</li>
|
||||
)
|
||||
<BumpLink
|
||||
as={Link}
|
||||
href={link.href}
|
||||
className="py-3"
|
||||
title={
|
||||
<h4 data-testid="link-with-intro-title">
|
||||
<span
|
||||
dangerouslySetInnerHTML={
|
||||
link.fullTitle ? { __html: link.fullTitle } : { __html: link.title }
|
||||
}
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
>
|
||||
{!link.hideIntro && link.intro && (
|
||||
<TruncateLines as="p" maxLines={2} className="color-fg-muted mb-0 mt-1">
|
||||
<span
|
||||
data-testid="link-with-intro-intro"
|
||||
dangerouslySetInnerHTML={{ __html: link.intro }}
|
||||
/>
|
||||
</TruncateLines>
|
||||
)}
|
||||
{link.date && (
|
||||
<time
|
||||
className="tooltipped tooltipped-n color-fg-muted text-mono mt-1"
|
||||
aria-label={dayjs(link.date).format('LLL')}
|
||||
>
|
||||
{dayjs(link.date).format('MMMM DD')}
|
||||
</time>
|
||||
)}
|
||||
</BumpLink>
|
||||
</ActionList.Item>
|
||||
),
|
||||
}
|
||||
})}
|
||||
</ul>
|
||||
></ActionList>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ import cx from 'classnames'
|
||||
import { useState } from 'react'
|
||||
|
||||
import { ChevronDownIcon } from '@primer/octicons-react'
|
||||
import { ActionList } from '@primer/components'
|
||||
|
||||
import { ProductTreeNode, useMainContext } from 'components/context/MainContext'
|
||||
import { Link } from 'components/Link'
|
||||
|
||||
const maxArticles = 10
|
||||
const maxArticles = 5
|
||||
|
||||
export const ProductArticlesList = () => {
|
||||
const { currentProductTree } = useMainContext()
|
||||
@@ -39,27 +40,35 @@ const ProductTreeNodeList = ({ treeNode }: { treeNode: ProductTreeNode }) => {
|
||||
</Link>
|
||||
</h4>
|
||||
|
||||
<ul className="list-style-none">
|
||||
{treeNode.childPages.map((childNode, index) => {
|
||||
if (treeNode.childPages[0].page.documentType === 'mapTopic' && childNode.page.hidden) {
|
||||
return null
|
||||
<ActionList
|
||||
{...{ as: 'ul' }}
|
||||
items={treeNode.childPages.map((childNode, index) => {
|
||||
return {
|
||||
renderItem: () => (
|
||||
<ActionList.Item
|
||||
as="li"
|
||||
key={childNode.href + index}
|
||||
className={cx('pl-0', !isShowingMore && index >= maxArticles ? 'd-none' : null)}
|
||||
sx={{
|
||||
borderRadius: 0,
|
||||
':hover': {
|
||||
borderRadius: 0,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Link className="d-block width-full" href={childNode.href}>
|
||||
{childNode.page.title}
|
||||
{childNode.page.documentType === 'mapTopic' ? (
|
||||
<small className="color-fg-muted d-inline-block">
|
||||
• {childNode.childPages.length} articles
|
||||
</small>
|
||||
) : null}
|
||||
</Link>
|
||||
</ActionList.Item>
|
||||
),
|
||||
}
|
||||
|
||||
return (
|
||||
<li
|
||||
key={childNode.href + index}
|
||||
className={cx('mb-3', !isShowingMore && index >= maxArticles ? 'd-none' : null)}
|
||||
>
|
||||
<Link href={childNode.href}>{childNode.page.title}</Link>
|
||||
{childNode.page.documentType === 'mapTopic' ? (
|
||||
<small className="color-fg-muted d-inline-block">
|
||||
• {childNode.childPages.length} articles
|
||||
</small>
|
||||
) : null}
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
></ActionList>
|
||||
{!isShowingMore && treeNode.childPages.length > maxArticles && (
|
||||
<button onClick={() => setIsShowingMore(true)} className="btn-link Link--secondary">
|
||||
Show {treeNode.childPages.length - maxArticles} more{' '}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useRouter } from 'next/router'
|
||||
import cx from 'classnames'
|
||||
|
||||
import { ActionList } from '@primer/components'
|
||||
import { Link } from 'components/Link'
|
||||
import { BumpLink } from 'components/ui/BumpLink'
|
||||
import type { TocItem } from 'components/context/ProductLandingContext'
|
||||
@@ -16,47 +17,57 @@ export const TableOfContents = (props: Props) => {
|
||||
return (
|
||||
<ul
|
||||
data-testid="table-of-contents"
|
||||
className={cx(variant === 'compact' ? 'list-style-inside pl-2' : 'list-style-none')}
|
||||
className={cx(variant === 'compact' ? 'list-style-outside pl-2' : 'list-style-none')}
|
||||
>
|
||||
{(items || []).map((item) => {
|
||||
if (!item) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { fullPath: href, title, intro, childTocItems } = item
|
||||
const isActive = router.pathname === href
|
||||
return variant === 'compact' ? (
|
||||
<li key={href} className="f4 my-1">
|
||||
<Link href={href}>{title}</Link>
|
||||
{(childTocItems || []).length > 0 && (
|
||||
<ul
|
||||
className={cx(
|
||||
variant === 'compact' ? 'list-style-circle pl-5 my-3' : 'list-style-none'
|
||||
)}
|
||||
>
|
||||
{(childTocItems || []).map((childItem) => {
|
||||
if (!childItem) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<li key={childItem.fullPath} className="f4 mt-1">
|
||||
<Link href={childItem.fullPath}>{childItem.title}</Link>
|
||||
<ActionList
|
||||
items=
|
||||
{(items || []).filter(item => typeof item !== 'undefined').map((item) => {
|
||||
const { fullPath: href, title, intro, childTocItems } = item
|
||||
const isActive = router.pathname === href
|
||||
return (variant === 'compact') ? {
|
||||
key: href,
|
||||
text: title,
|
||||
renderItem: () => (
|
||||
<ActionList.Item>
|
||||
<li key={href} className="f4 d-list-item width-full">
|
||||
<Link className="d-block width-full" href={href}>{title}</Link>
|
||||
{(childTocItems || []).length > 0 && (
|
||||
<ul
|
||||
className={cx(
|
||||
variant === 'compact' ? 'list-style-circle pl-5 my-3' : 'list-style-none'
|
||||
)}
|
||||
>
|
||||
{(childTocItems || []).map((childItem) => {
|
||||
if (!childItem) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<li key={childItem.fullPath} className="f4 d-block width-full">
|
||||
<Link className="d-block width-full" href={childItem.fullPath}>{childItem.title}</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
</li>
|
||||
) : (
|
||||
<li key={href} className={cx('mb-3 border-bottom pb-2', isActive && 'color-fg-muted')}>
|
||||
<BumpLink as={Link} href={href} title={<h2 className="h4">{title}</h2>}>
|
||||
{intro && (
|
||||
<p className="f4 color-fg-muted" dangerouslySetInnerHTML={{ __html: intro }} />
|
||||
)}
|
||||
</BumpLink>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ActionList.Item>
|
||||
)
|
||||
} : {
|
||||
key: href,
|
||||
title: title,
|
||||
renderItem: () => (
|
||||
<ActionList.Item className={cx('border-bottom')}>
|
||||
<li key={href} className={cx('mt-2', isActive && 'color-fg-muted')}>
|
||||
<BumpLink as={Link} href={href} title={<h2 className="py-1 h4">{title}</h2>}>
|
||||
{intro && (
|
||||
<p className="f4 color-fg-muted" dangerouslySetInnerHTML={{ __html: intro }} />
|
||||
)}
|
||||
</BumpLink>
|
||||
</li>
|
||||
</ActionList.Item>
|
||||
)
|
||||
}
|
||||
})} />
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export function GHESReleaseNotePatch({
|
||||
)}
|
||||
</div>
|
||||
|
||||
<p className="color-fg-muted mt-1">{dayjs(patch.date).format('MMMM, DD, YYYY')}</p>
|
||||
<p className="color-fg-muted mt-1">{dayjs(patch.date).format('MMMM DD, YYYY')}</p>
|
||||
|
||||
{patch.version !== latestPatch && currentVersion.currentRelease === latestRelease && (
|
||||
<p className="color-fg-muted mt-1">
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
ArticleGuide,
|
||||
useProductSubLandingContext,
|
||||
} from 'components/context/ProductSubLandingContext'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
import { ArticleCard } from './ArticleCard'
|
||||
|
||||
const PAGE_SIZE = 9
|
||||
export const ArticleCards = () => {
|
||||
const { t } = useTranslation('product_sublanding')
|
||||
const guideTypes: Record<string, string> = t('guide_types')
|
||||
const { allTopics, includeGuides } = useProductSubLandingContext()
|
||||
const [numVisible, setNumVisible] = useState(PAGE_SIZE)
|
||||
const [typeFilter, setTypeFilter] = useState('')
|
||||
const [topicFilter, setTopicFilter] = useState('')
|
||||
const [filteredResults, setFilteredResults] = useState<Array<ArticleGuide>>([])
|
||||
|
||||
useEffect(() => {
|
||||
setNumVisible(PAGE_SIZE)
|
||||
setFilteredResults(
|
||||
(includeGuides || []).filter((card) => {
|
||||
const matchesType = card.type === typeFilter
|
||||
const matchesTopic = card.topics.some((key) => key === topicFilter)
|
||||
return (typeFilter ? matchesType : true) && (topicFilter ? matchesTopic : true)
|
||||
})
|
||||
)
|
||||
}, [typeFilter, topicFilter])
|
||||
|
||||
const isUserFiltering = typeFilter !== '' || topicFilter !== ''
|
||||
const onChangeTypeFilter = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setTypeFilter(e.target.value)
|
||||
}
|
||||
const onChangeTopicFilter = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setTopicFilter(e.target.value)
|
||||
}
|
||||
|
||||
const guides = isUserFiltering ? filteredResults : includeGuides || []
|
||||
|
||||
return (
|
||||
<div>
|
||||
<label htmlFor="guide-filter-form">{t('filter_instructions')}</label>
|
||||
<form name="guide-filter-form" className="mt-2 mb-5 d-flex d-flex">
|
||||
<div>
|
||||
<label htmlFor="type" className="text-uppercase f6 color-fg-muted d-block">
|
||||
{t('filters.type')}
|
||||
</label>
|
||||
<select
|
||||
value={typeFilter}
|
||||
className="form-select f4 text-bold border-0 rounded-0 border-top box-shadow-none pl-0"
|
||||
name="type"
|
||||
aria-label="guide types"
|
||||
data-testid="card-filter-dropdown"
|
||||
onChange={onChangeTypeFilter}
|
||||
>
|
||||
<option value="">{t('filters.all')}</option>
|
||||
{Object.entries(guideTypes).map(([key, val]) => {
|
||||
return (
|
||||
<option key={key} value={key}>
|
||||
{val}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
<div className="mx-4">
|
||||
<label htmlFor="topic" className="text-uppercase f6 color-fg-muted d-block">
|
||||
{t('filters.topic')}
|
||||
</label>
|
||||
<select
|
||||
value={topicFilter}
|
||||
className="form-select f4 text-bold border-0 rounded-0 border-top box-shadow-none pl-0"
|
||||
name="topics"
|
||||
data-testid="card-filter-dropdown"
|
||||
aria-label="guide topics"
|
||||
onChange={onChangeTopicFilter}
|
||||
>
|
||||
<option value="">{t('filters.all')}</option>
|
||||
{allTopics?.map((topic) => {
|
||||
return (
|
||||
<option key={topic} value={topic}>
|
||||
{topic}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div role="status" className="color-fg-muted">
|
||||
{guides.length === 0
|
||||
? t('guides_found.none')
|
||||
: guides.length === 1
|
||||
? t('guides_found.one')
|
||||
: t('guides_found.multiple').replace('{n}', guides.length)}
|
||||
</div>
|
||||
|
||||
<div className="d-flex flex-wrap mr-0 mr-md-n6 mr-lg-n8">
|
||||
{guides.slice(0, numVisible).map((card) => {
|
||||
return <ArticleCard key={card.href} card={card} typeLabel={guideTypes[card.type]} />
|
||||
})}
|
||||
</div>
|
||||
|
||||
{guides.length > numVisible && (
|
||||
<button
|
||||
className="col-12 mt-5 text-center text-bold color-fg-accent btn-link"
|
||||
onClick={() => setNumVisible(numVisible + PAGE_SIZE)}
|
||||
>
|
||||
{t('load_more')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -34,13 +34,12 @@ See the [contributing docs](/CONTRIBUTING.md) for general information about work
|
||||
- [Escaping single quotes](#escaping-single-quotes)
|
||||
- [Autogenerated mini TOCs](#autogenerated-mini-tocs)
|
||||
- [Versioning](#versioning)
|
||||
- [Free-pro-team vs. GitHub.com versioning](#free-pro-team-vs-githubcom-versioning)
|
||||
- [Filenames](#filenames)
|
||||
- [Whitespace control](#whitespace-control)
|
||||
- [Links and image paths](#links-and-image-paths)
|
||||
- [Preventing transformations](#preventing-transformations)
|
||||
- [Index pages](#index-pages)
|
||||
- [Creating new sublanding pages](#creating-new-sublanding-pages)
|
||||
- [Creating new product guides pages](#creating-new-product-guides-pages)
|
||||
|
||||
## Frontmatter
|
||||
|
||||
@@ -244,7 +243,7 @@ defaultTool: cli
|
||||
**Note: the featured track is set by a specific property in the learning tracks YAML. See that [README](../data/learning-tracks/README.md) for details.*
|
||||
|
||||
### `includeGuides`
|
||||
- Purpose: Render a list of articles, filterable by `type` and `topics`. Only applicable when used with `layout: product-sublanding`.
|
||||
- Purpose: Render a list of articles, filterable by `type` and `topics`. Only applicable when used with `layout: product-guides`.
|
||||
- Type: `Array`
|
||||
- Optional.
|
||||
|
||||
@@ -319,11 +318,7 @@ A content file can have **two** types of versioning:
|
||||
* Liquid statements in content (**optional**)
|
||||
* Conditionally render content depending on the current version being viewed. See [contributing/liquid-helpers](../contributing/liquid-helpers.md) for more info. Note Liquid conditionals can also appear in `data` and `include` files.
|
||||
|
||||
### Free-pro-team vs. GitHub.com versioning
|
||||
|
||||
As of early 2021, the `free-pro-team@latest` version is **only** supported in content files (in both frontmatter and Liquid versioning) and throughout the docs site backend. It is **not** user facing. A helper function called `lib/remove-fpt-from-path.js` removes the version from URLs. Users now select `GitHub.com` in the Article Versions dropdown instead of `Free, Pro, Team`.
|
||||
|
||||
The convenience function allows us to continue supporting a consistent versioning structure under-the-hood while not displaying plan information to users that may be potentially confusing.
|
||||
**Note**: As of early 2021, the `free-pro-team@latest` version is not included URLs. A helper function called `lib/remove-fpt-from-path.js` removes the version from URLs.
|
||||
|
||||
## Filenames
|
||||
|
||||
@@ -381,11 +376,11 @@ The homepage is the main Table of Contents file for the docs site. The homepage
|
||||
|
||||
`childGroups` is an array of mappings containing a `name` for the group, an optional `icon` for the group, and an array of `children`. The `children` in the array must be present in the `children` frontmatter property.
|
||||
|
||||
### Creating new sublanding pages
|
||||
### Creating new product guides pages
|
||||
|
||||
To create a sublanding page (e.g. [Actions' Guide page](https://docs.github.com/en/actions/guides)), create or modify an existing markdown file with these specific frontmatter values:
|
||||
To create a product guides page (e.g. [Actions' Guide page](https://docs.github.com/en/actions/guides)), create or modify an existing markdown file with these specific frontmatter values:
|
||||
|
||||
1. Use the sublanding page template by referencing it `layout: product-sublanding`
|
||||
1. Use the product guides page template by referencing it `layout: product-guides`
|
||||
2. (optional) Include the learning tracks in [`learningTracks`](#learningTracks)
|
||||
3. (optional) Define which articles to include with [`includeGuides`](#includeGuides).
|
||||
|
||||
|
||||
@@ -133,11 +133,15 @@ runs:
|
||||
|
||||
For more information on how to use context syntax, see "[Contexts](/actions/learn-github-actions/contexts)."
|
||||
|
||||
## `runs`
|
||||
|
||||
**Required** Specifies whether this is a JavaScript action, a composite action or a Docker action and how the action is executed.
|
||||
|
||||
## `runs` for JavaScript actions
|
||||
|
||||
**Required** Configures the path to the action's code and the application used to execute the code.
|
||||
**Required** Configures the path to the action's code and the runtime used to execute the code.
|
||||
|
||||
### Example using Node.js
|
||||
### Example using Node.js v12
|
||||
|
||||
```yaml
|
||||
runs:
|
||||
@@ -147,15 +151,18 @@ runs:
|
||||
|
||||
### `runs.using`
|
||||
|
||||
**Required** The application used to execute the code specified in [`main`](#runsmain).
|
||||
**Required** The runtime used to execute the code specified in [`main`](#runsmain).
|
||||
|
||||
- Use `node12` for Node.js v12.
|
||||
- Use `node16` for Node.js v16.
|
||||
|
||||
### `runs.main`
|
||||
|
||||
**Required** The file that contains your action code. The application specified in [`using`](#runsusing) executes this file.
|
||||
**Required** The file that contains your action code. The runtime specified in [`using`](#runsusing) executes this file.
|
||||
|
||||
### `pre`
|
||||
|
||||
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
||||
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The runtime specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
||||
|
||||
In this example, the `pre:` action runs a script called `setup.js`:
|
||||
|
||||
@@ -181,7 +188,7 @@ In this example, `cleanup.js` only runs on Linux-based runners:
|
||||
|
||||
### `post`
|
||||
|
||||
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the [`using`](#runsusing) syntax will execute this file.
|
||||
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The runtime specified with the [`using`](#runsusing) syntax will execute this file.
|
||||
|
||||
In this example, the `post:` action runs a script called `cleanup.js`:
|
||||
|
||||
@@ -207,11 +214,11 @@ For example, this `cleanup.js` will only run on Linux-based runners:
|
||||
|
||||
## `runs` for composite actions
|
||||
|
||||
**Required** Configures the path to the composite action, and the application used to execute the code.
|
||||
**Required** Configures the path to the composite action.
|
||||
|
||||
### `runs.using`
|
||||
|
||||
**Required** To use a composite action, set this to `"composite"`.
|
||||
**Required** You must set this value to `'composite'`.
|
||||
|
||||
### `runs.steps`
|
||||
|
||||
@@ -354,7 +361,7 @@ runs:
|
||||
|
||||
**Optional** Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. {% data variables.product.prodname_actions %} uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using [`pre-if`](#pre-if).
|
||||
|
||||
The application specified with the [`using`](#runsusing) syntax will execute this file.
|
||||
The runtime specified with the [`using`](#runsusing) syntax will execute this file.
|
||||
|
||||
In this example, the `pre-entrypoint:` action runs a script called `setup.sh`:
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ topics:
|
||||
- Community
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
---
|
||||
@@ -37,7 +38,7 @@ JavaScript actions are Node.js repositories with metadata. However, JavaScript a
|
||||
|
||||
* Dependent packages are committed alongside the code, typically in a compiled and minified form. This means that automated builds and secure community contributions are important.
|
||||
|
||||
{% ifversion fpt %}
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
* Tagged releases can be published directly to {% data variables.product.prodname_marketplace %} and consumed by workflows across {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
@@ -54,7 +55,7 @@ To support the developer process in the next section, add two {% data variables.
|
||||
|
||||
### Example developer process
|
||||
|
||||
Here is an example process that you can follow to automatically run tests, create a release{% ifversion fpt%} and publish to {% data variables.product.prodname_marketplace %}{% endif %}, and publish your action.
|
||||
Here is an example process that you can follow to automatically run tests, create a release{% ifversion fpt or ghec%} and publish to {% data variables.product.prodname_marketplace %}{% endif %}, and publish your action.
|
||||
|
||||
1. Do feature work in branches per GitHub flow. For more information, see "[GitHub flow](/get-started/quickstart/github-flow)."
|
||||
* Whenever a commit is pushed to the feature branch, your testing workflow will automatically run the tests.
|
||||
@@ -65,7 +66,7 @@ Here is an example process that you can follow to automatically run tests, creat
|
||||
|
||||
* **Note:** for security reasons, workflows triggered by `pull_request` from forks have restricted `GITHUB_TOKEN` permissions and do not have access to secrets. If your tests or other workflows triggered upon pull request require access to secrets, consider using a different event like a [manual trigger](/actions/reference/events-that-trigger-workflows#manual-events) or a [`pull_request_target`](/actions/reference/events-that-trigger-workflows#pull_request_target). Read more [here](/actions/reference/events-that-trigger-workflows#pull-request-events-for-forked-repositories).
|
||||
|
||||
3. Create a semantically tagged release. {% ifversion fpt %} You may also publish to {% data variables.product.prodname_marketplace %} with a simple checkbox. {% endif %} For more information, see "[Managing releases in a repository](/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release)"{% ifversion fpt %} and "[Publishing actions in {% data variables.product.prodname_marketplace %}](/actions/creating-actions/publishing-actions-in-github-marketplace#publishing-an-action)"{% endif %}.
|
||||
3. Create a semantically tagged release. {% ifversion fpt or ghec %} You may also publish to {% data variables.product.prodname_marketplace %} with a simple checkbox. {% endif %} For more information, see "[Managing releases in a repository](/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release)"{% ifversion fpt or ghec %} and "[Publishing actions in {% data variables.product.prodname_marketplace %}](/actions/creating-actions/publishing-actions-in-github-marketplace#publishing-an-action)"{% endif %}.
|
||||
|
||||
* When a release is published or edited, your release workflow will automatically take care of compilation and adjusting tags.
|
||||
|
||||
@@ -82,7 +83,7 @@ Using semantic releases means that the users of your actions can pin their workf
|
||||
{% data variables.product.product_name %} provides tools and guides to help you work with the open source community. Here are a few tools we recommend setting up for healthy bidirectional communication. By providing the following signals to the community, you encourage others to use, modify, and contribute to your action:
|
||||
|
||||
* Maintain a `README` with plenty of usage examples and guidance. For more information, see "[About READMEs](/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes)."
|
||||
* Include a workflow status badge in your `README` file. For more information, see "[Adding a workflow status badge](/actions/managing-workflow-runs/adding-a-workflow-status-badge)." Also visit [shields.io](https://shields.io/) to learn about other badges that you can add.{% ifversion fpt %}
|
||||
* Include a workflow status badge in your `README` file. For more information, see "[Adding a workflow status badge](/actions/managing-workflow-runs/adding-a-workflow-status-badge)." Also visit [shields.io](https://shields.io/) to learn about other badges that you can add.{% ifversion fpt or ghec %}
|
||||
* Add community health files like `CODE_OF_CONDUCT`, `CONTRIBUTING`, and `SECURITY`. For more information, see "[Creating a default community health file](/github/building-a-strong-community/creating-a-default-community-health-file#supported-file-types)."{% endif %}
|
||||
* Keep issues current by utilizing actions like [actions/stale](https://github.com/actions/stale).
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ You can configure environments with protection rules and secrets. When a workflo
|
||||
{% ifversion fpt %}
|
||||
{% note %}
|
||||
|
||||
**Note:** If you don't use {% data variables.product.prodname_ghe_cloud %} and convert a repository from public to private, any configured protection rules or environment secrets will be ignored, and you will not be able to configure any environments. If you convert your repository back to public, you will have access to any previously configured protection rules and environment secrets. {% data reusables.enterprise.link-to-ghec-trial %}
|
||||
**Note:** You can only configure environments for public repositories. If you convert a repository from public to private, any configured protection rules or environment secrets will be ignored, and you will not be able to configure any environments. If you convert your repository back to public, you will have access to any previously configured protection rules and environment secrets.
|
||||
|
||||
Organizations that use {% data variables.product.prodname_ghe_cloud %} can configure environments for private repositories. For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/actions/deployment/targeting-different-environments/using-environments-for-deployment). {% data reusables.enterprise.link-to-ghec-trial %}
|
||||
|
||||
{% endnote %}
|
||||
{% endif %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Guides for GitHub Actions
|
||||
intro: 'These guides for {% data variables.product.prodname_actions %} include specific use cases and examples to help you configure workflows.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
layout: product-sublanding
|
||||
layout: product-guides
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
|
||||
@@ -81,11 +81,13 @@ You can add self-hosted runners at the organization level, where they can be use
|
||||
|
||||
## Adding a self-hosted runner to an enterprise
|
||||
|
||||
You can add self-hosted runners to an enterprise, where they can be assigned to multiple organizations. The organization admins are then able to control which repositories can use it.
|
||||
{% ifversion fpt %}If you use {% data variables.product.prodname_ghe_cloud %}, you{% elsif ghec or ghes or ghae %}You{% endif %} can add self-hosted runners to an enterprise, where they can be assigned to multiple organizations. The organization admins are then able to control which repositories can use it. {% ifversion fpt %}For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/actions/hosting-your-own-runners/adding-self-hosted-runners#adding-a-self-hosted-runner-to-an-enterprise).{% endif %}
|
||||
|
||||
{% ifversion ghec or ghes or ghae %}
|
||||
|
||||
New runners are assigned to the default group. You can modify the runner's group after you've registered the runner. For more information, see "[Managing access to self-hosted runners](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups#moving-a-self-hosted-runner-to-a-group)."
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% ifversion ghec %}
|
||||
To add a self-hosted runner to an enterprise account, you must be an enterprise owner. For information about how to add a self-hosted runner with the REST API, see the [Enterprise Administration GitHub Actions APIs](/rest/reference/enterprise-admin#github-actions).
|
||||
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
@@ -104,9 +106,11 @@ To add a self-hosted runner at the enterprise level of {% data variables.product
|
||||
1. Click **Add new**, then click **New runner**.
|
||||
{% data reusables.github-actions.self-hosted-runner-configure %}
|
||||
{% endif %}
|
||||
{% ifversion ghec or ghae or ghes %}
|
||||
{% data reusables.github-actions.self-hosted-runner-check-installation-success %}
|
||||
|
||||
{% data reusables.github-actions.self-hosted-runner-public-repo-access %}
|
||||
{% endif %}
|
||||
|
||||
### Making enterprise runners available to repositories
|
||||
|
||||
@@ -115,3 +119,4 @@ By default, runners in an enterprise's "Default" self-hosted runner group are av
|
||||
To make an enterprise-level self-hosted runner group available to an organization repository, you might need to change the organization's inherited settings for the runner group to make the runner available to repositories in the organization.
|
||||
|
||||
For more information on changing runner group access settings, see "[Managing access to self-hosted runners using groups](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups#changing-the-access-policy-of-a-self-hosted-runner-group)."
|
||||
{% endif %}
|
||||
|
||||
@@ -19,14 +19,19 @@ shortTitle: Manage runner groups
|
||||
|
||||
## About self-hosted runner groups
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% ifversion fpt %}
|
||||
{% note %}
|
||||
|
||||
**Note:** All organizations have a single default self-hosted runner group. Only enterprise accounts and organizations owned by enterprise accounts can create and manage additional self-hosted runner groups.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
Self-hosted runner groups are used to control access to self-hosted runners. Organization admins can configure access policies that control which repositories in an organization have access to the runner group.
|
||||
|
||||
If you use {% data variables.product.prodname_ghe_cloud %}, you can create additional runner groups; enterprise admins can configure access policies that control which organizations in an enterprise have access to the runner group; and organization admins can assign additional granular repository access policies to the enterprise runner group. For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups).
|
||||
{% endif %}
|
||||
|
||||
{% ifversion ghec or ghes or ghae %}
|
||||
Self-hosted runner groups are used to control access to self-hosted runners at the organization and enterprise level. Enterprise admins can configure access policies that control which organizations in an enterprise have access to the runner group. Organization admins can configure access policies that control which repositories in an organization have access to the runner group.
|
||||
|
||||
When an enterprise admin grants an organization access to a runner group, organization admins can see the runner group listed in the organization's self-hosted runner settings. The organizations admins can then assign additional granular repository access policies to the enterprise runner group.
|
||||
@@ -41,7 +46,7 @@ Self-hosted runners are automatically assigned to the default group when created
|
||||
|
||||
When creating a group, you must choose a policy that defines which repositories have access to the runner group.
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% ifversion ghec %}
|
||||
{% data reusables.organizations.navigate-to-org %}
|
||||
{% data reusables.organizations.org_settings %}
|
||||
{% data reusables.github-actions.settings-sidebar-actions-runner-groups %}
|
||||
@@ -90,7 +95,7 @@ Self-hosted runners are automatically assigned to the default group when created
|
||||
|
||||
When creating a group, you must choose a policy that defines which organizations have access to the runner group.
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% ifversion ghec %}
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% data reusables.enterprise-accounts.policies-tab %}
|
||||
{% data reusables.enterprise-accounts.actions-tab %}
|
||||
@@ -134,6 +139,7 @@ When creating a group, you must choose a policy that defines which organizations
|
||||

|
||||
1. Click **Save group** to create the group and apply the policy.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
## Changing the access policy of a self-hosted runner group
|
||||
|
||||
@@ -156,6 +162,8 @@ You can update the access policy of a runner group, or rename a runner group.
|
||||
{% ifversion ghae or ghes %}
|
||||
{% data reusables.github-actions.self-hosted-runner-configure-runner-group-access %}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion ghec or ghes or ghae %}
|
||||
## Automatically adding a self-hosted runner to a group
|
||||
|
||||
You can use the configuration script to automatically add a new self-hosted runner to a group. For example, this command registers a new self-hosted runner and uses the `--runnergroup` parameter to add it to a group named `rg-runnergroup`.
|
||||
@@ -173,29 +181,31 @@ Could not find any self-hosted runner group named "rg-runnergroup".
|
||||
## Moving a self-hosted runner to a group
|
||||
|
||||
If you don't specify a runner group during the registration process, your new self-hosted runners are automatically assigned to the default group, and can then be moved to another group.
|
||||
{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
{% ifversion ghec or ghes > 3.1 or ghae-next %}
|
||||
{% data reusables.github-actions.self-hosted-runner-navigate-to-org-enterprise %}
|
||||
1. In the "Runners" list, click the runner that you want to configure.
|
||||
1. Select the Runner group dropdown menu.
|
||||
1. In "Move runner to group", choose a destination group for the runner.
|
||||
{% else %}
|
||||
2. Select the Runner group dropdown menu.
|
||||
3. In "Move runner to group", choose a destination group for the runner.
|
||||
{% endif %}
|
||||
{% ifversion ghes < 3.2 or ghae %}
|
||||
1. In the "Self-hosted runners" section of the settings page, locate the current group of the runner you want to move and expand the list of group members.
|
||||

|
||||
1. Select the checkbox next to the self-hosted runner, and then click **Move to group** to see the available destinations.
|
||||
2. Select the checkbox next to the self-hosted runner, and then click **Move to group** to see the available destinations.
|
||||

|
||||
1. To move the runner, click on the destination group.
|
||||
3. To move the runner, click on the destination group.
|
||||

|
||||
{% endif %}
|
||||
## Removing a self-hosted runner group
|
||||
|
||||
Self-hosted runners are automatically returned to the default group when their group is removed.
|
||||
|
||||
{% ifversion fpt or ghes > 3.1 or ghae-next or ghec %}
|
||||
{% ifversion ghes > 3.1 or ghae-next or ghec %}
|
||||
{% data reusables.github-actions.self-hosted-runner-groups-navigate-to-repo-org-enterprise %}
|
||||
1. In the list of groups, to the right of the group you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}.
|
||||
1. To remove the group, click **Remove group**.
|
||||
1. Review the confirmation prompts, and click **Remove this runner group**.
|
||||
{% else %}
|
||||
2. To remove the group, click **Remove group**.
|
||||
3. Review the confirmation prompts, and click **Remove this runner group**.
|
||||
{% endif %}
|
||||
{% ifversion ghes < 3.2 or ghae %}
|
||||
1. In the "Self-hosted runners" section of the settings page, locate the group you want to delete, and click the {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} button.
|
||||

|
||||
|
||||
@@ -204,3 +214,4 @@ Self-hosted runners are automatically returned to the default group when their g
|
||||
|
||||
1. Review the confirmation prompts, and click **Remove this runner group**.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Removing self-hosted runners
|
||||
intro: 'You can permanently remove a self-hosted runner from a repository, an organization, or an enterprise.'
|
||||
intro: 'You can permanently remove a self-hosted runner from a repository{% ifversion fpt %} or organization{% elsif ghec or ghes or gahe %}, an organization, or an enterprise{% endif %}.'
|
||||
redirect_from:
|
||||
- /github/automating-your-workflow-with-github-actions/removing-self-hosted-runners
|
||||
- /actions/automating-your-workflow-with-github-actions/removing-self-hosted-runners
|
||||
@@ -73,6 +73,10 @@ To remove a self-hosted runner from an organization, you must be an organization
|
||||
{% endif %}
|
||||
## Removing a runner from an enterprise
|
||||
|
||||
{% ifversion fpt %}
|
||||
If you use {% data variables.product.prodname_ghe_cloud %}, you can also remove runners from an enterprise. For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/actions/hosting-your-own-runners/removing-self-hosted-runners#removing-a-runner-from-an-enterprise).
|
||||
{% endif %}
|
||||
{% ifversion ghec or ghes or ghae %}
|
||||
{% note %}
|
||||
|
||||
**Note:** {% data reusables.github-actions.self-hosted-runner-removal-impact %}
|
||||
@@ -80,9 +84,10 @@ To remove a self-hosted runner from an organization, you must be an organization
|
||||
{% data reusables.github-actions.self-hosted-runner-auto-removal %}
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% data reusables.github-actions.self-hosted-runner-reusing %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% ifversion ghec %}
|
||||
To remove a self-hosted runner from an enterprise account, you must be an enterprise owner. We recommend that you also have access to the self-hosted runner machine. For information about how to add a self-hosted runner with the REST API, see the [Enterprise Administration GitHub Actions APIs](/rest/reference/enterprise-admin#github-actions).
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% data reusables.enterprise-accounts.policies-tab %}
|
||||
@@ -98,3 +103,4 @@ To remove a self-hosted runner at the enterprise level of {% data variables.prod
|
||||
{% data reusables.enterprise-accounts.actions-runners-tab %}
|
||||
{% data reusables.github-actions.self-hosted-runner-removing-a-runner %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -73,7 +73,7 @@ You can use the configuration script on the self-hosted runner to create and ass
|
||||
./config.sh --labels gpu
|
||||
```
|
||||
|
||||
The label is created if it does not already exist. You can also use this approach to assign the default labels to runners, such as `x64` or `linux`. When default labels are assigned using the configuration script, {% data variables.product.prodname_actions %} accepts them as given and does not validate that the runner is actually using that operating system or architecture.
|
||||
The label is created if it does not already exist. You can also use this approach to assign the default labels to runners, such as `x64` or `linux`. When default labels are assigned using the configuration script, {% data variables.product.prodname_actions %} accepts them as given and does not validate that the runner is actually using that operating system or architecture.
|
||||
|
||||
You can use comma separation to assign multiple labels. For example:
|
||||
|
||||
|
||||
@@ -23,48 +23,55 @@ topics:
|
||||
|
||||
## Overview
|
||||
|
||||
{% data reusables.actions.about-actions %} {% data variables.product.prodname_actions %} are event-driven, meaning that you can run a series of commands after a specified event has occurred. For example, every time someone creates a pull request for a repository, you can automatically run a command that executes a software testing script.
|
||||
{% data reusables.actions.about-actions %} You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.
|
||||
|
||||
This diagram demonstrates how you can use {% data variables.product.prodname_actions %} to automatically run your software testing scripts. An event automatically triggers the _workflow_, which contains a _job_. The job then uses _steps_ to control the order in which _actions_ are run. These actions are the commands that automate your software testing.
|
||||
{% data variables.product.prodname_actions %} goes beyond just DevOps and lets you run workflows when other events happen in your repository. For example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository.
|
||||
|
||||

|
||||
{% data variables.product.prodname_dotcom %} provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host your own self-hosted runners in your own data center or cloud infrastructure.
|
||||
|
||||
## The components of {% data variables.product.prodname_actions %}
|
||||
|
||||
Below is a list of the multiple {% data variables.product.prodname_actions %} components that work together to run jobs. You can see how these components interact with each other.
|
||||
You can configure a {% data variables.product.prodname_actions %} _workflow_ to be triggered when an _event_ occurs in your repository, such as a pull request being opened or an issue being created. Your workflow contains one or more _jobs_ which can run in sequential order or in parallel. Each job will run inside its own virtual machine _runner_, or inside a container, and has one or more _steps_ that either run a script that you define or run an _action_, which is a reusable extension that can simplify in your workflow.
|
||||
|
||||

|
||||

|
||||
|
||||
### Workflows
|
||||
|
||||
The workflow is an automated procedure that you add to your repository. Workflows are made up of one or more jobs and can be scheduled or triggered by an event. The workflow can be used to build, test, package, release, or deploy a project on {% data variables.product.prodname_dotcom %}. {% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}You can reference a workflow within another workflow, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."{% endif %}
|
||||
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
|
||||
|
||||
Your repository can have multiple workflows in a repository, each of which can perform a different set of steps. For example, you can have one workflow to build and test pull requests, another workflow to deploy your application every time a release is created, and still another workflow that adds a label every time someone opens a new issue.
|
||||
|
||||
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}You can reference a workflow within another workflow, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."{% endif %}
|
||||
|
||||
### Events
|
||||
|
||||
An event is a specific activity that triggers a workflow. For example, activity can originate from {% data variables.product.prodname_dotcom %} when someone pushes a commit to a repository or when an issue or pull request is created. You can also use the [repository dispatch webhook](/rest/reference/repos#create-a-repository-dispatch-event) to trigger a workflow when an external event occurs. For a complete list of events that can be used to trigger workflows, see [Events that trigger workflows](/actions/reference/events-that-trigger-workflows).
|
||||
An event is a specific activity in a repository that triggers a workflow run. For example, activity can originate from {% data variables.product.prodname_dotcom %} when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow run on a schedule, by [posting to a REST API](/rest/reference/repos#create-a-repository-dispatch-event), or manually.
|
||||
|
||||
For a complete list of events that can be used to trigger workflows, see [Events that trigger workflows](/actions/reference/events-that-trigger-workflows).
|
||||
|
||||
### Jobs
|
||||
|
||||
A job is a set of steps that execute on the same runner. By default, a workflow with multiple jobs will run those jobs in parallel. You can also configure a workflow to run jobs sequentially. For example, a workflow can have two sequential jobs that build and test code, where the test job is dependent on the status of the build job. If the build job fails, the test job will not run.
|
||||
A job is a set of _steps_ in a workflow that execute on the same runner. Each step is either a shell script that will be executed, or an _action_ that will be run. Steps are executed in order and are dependent on each other. Since each step is executed on the same runner, you can share data from one step to another. For example, you can have a step that builds your application followed by a step that tests the application that was built.
|
||||
|
||||
### Steps
|
||||
|
||||
A step is an individual task that can run commands in a job. A step can be either an _action_ or a shell command. Each step in a job executes on the same runner, allowing the actions in that job to share data with each other.
|
||||
You can configure a job's dependencies with other jobs; by default, jobs have no dependencies and run in parallel with each other. When a job takes a dependency on another job, it will wait for the dependent job to complete before it can run. For example, you may have multiple build jobs for different architectures that have no dependencies, and a packaging job that is dependent on those jobs. The build jobs will run in parallel, and when they have all completed successfully, the packaging job will run.
|
||||
|
||||
### Actions
|
||||
|
||||
_Actions_ are standalone commands that are combined into _steps_ to create a _job_. Actions are the smallest portable building block of a workflow. You can create your own actions, or use actions created by the {% data variables.product.prodname_dotcom %} community. To use an action in a workflow, you must include it as a step.
|
||||
An _action_ is a custom application for the {% data variables.product.prodname_actions %} platform that performs a complex but frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in your workflow files. An action can pull your git repository from {% data variables.product.prodname_dotcom %}, set up the correct toolchain for your build environment, or set up the authentication to your cloud provider.
|
||||
|
||||
You can write your own actions, or you can find actions to use in your workflows in the {% data variables.product.prodname_marketplace %}.
|
||||
|
||||
### Runners
|
||||
|
||||
{% ifversion ghae %}A runner is a server that has the [{% data variables.product.prodname_actions %} runner application](https://github.com/actions/runner) installed. For {% data variables.product.prodname_ghe_managed %}, you can use the security hardened {% data variables.actions.hosted_runner %}s which are bundled with your instance in the cloud. A runner listens for available jobs, runs one job at a time, and reports the progress, logs, and results back to {% data variables.product.prodname_dotcom %}. {% data variables.actions.hosted_runner %}s run each workflow job in a fresh virtual environment. For more information, see "[About {% data variables.actions.hosted_runner %}s](/actions/using-github-hosted-runners/about-ae-hosted-runners)."
|
||||
{% ifversion ghae %}
|
||||
{% data reusables.actions.about-runners %} For {% data variables.product.prodname_ghe_managed %}, you can use the security hardened {% data variables.actions.hosted_runner %}s that are bundled with your instance in the cloud. If you need a different operating system or require a specific hardware configuration, you can host your own runners. For information on self-hosted runners, see "[Hosting your own runners](/actions/hosting-your-own-runners)."
|
||||
{% else %}
|
||||
{% data reusables.actions.about-runners %} A runner listens for available jobs, runs one job at a time, and reports the progress, logs, and results back to {% data variables.product.prodname_dotcom %}. {% data variables.product.prodname_dotcom %}-hosted runners are based on Ubuntu Linux, Microsoft Windows, and macOS, and each job in a workflow runs in a fresh virtual environment. For information on {% data variables.product.prodname_dotcom %}-hosted runners, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)." If you need a different operating system or require a specific hardware configuration, you can host your own runners. For information on self-hosted runners, see "[Hosting your own runners](/actions/hosting-your-own-runners)."
|
||||
{% data reusables.actions.about-runners %} Each runner can run a single job at a time. {% data variables.product.prodname_dotcom %} provides Ubuntu Linux, Microsoft Windows, and macOS runners to run your workflows; each workflow run executes in a fresh, newly-provisioned virtual machine. If you need a different operating system or require a specific hardware configuration, you can host your own runners. For information on self-hosted runners, see "[Hosting your own runners](/actions/hosting-your-own-runners)."
|
||||
{% endif %}
|
||||
|
||||
## Create an example workflow
|
||||
|
||||
{% data variables.product.prodname_actions %} uses YAML syntax to define the events, jobs, and steps. These YAML files are stored in your code repository, in a directory called `.github/workflows`.
|
||||
{% data variables.product.prodname_actions %} uses YAML syntax to define the workflow. Each workflow is stored as a separate YAML file in your code repository, in a directory called `.github/workflows`.
|
||||
|
||||
You can create an example workflow in your repository that automatically triggers a series of commands whenever code is pushed. In this workflow, {% data variables.product.prodname_actions %} checks out the pushed code, installs the software dependencies, and runs `bats -v`.
|
||||
|
||||
@@ -112,7 +119,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Specify the event that automatically triggers the workflow file. This example uses the <code>push</code> event, so that the jobs run every time someone pushes a change to the repository. You can set up the workflow to only run on certain branches, paths, or tags. For syntax examples including or excluding branches, paths, or tags, see <a href="https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths">"Workflow syntax for {% data variables.product.prodname_actions %}."</a>
|
||||
Specifies the trigger for this workflow. This example uses the <code>push</code> event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request. This is triggered by a push to every branch; for examples of syntax that runs only on pushes to specific branches, paths, or tags, see <a href="https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths">"Workflow syntax for {% data variables.product.prodname_actions %}."</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -123,7 +130,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Groups together all the jobs that run in the <code>learn-github-actions</code> workflow file.
|
||||
Groups together all the jobs that run in the <code>learn-github-actions</code> workflow.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -134,7 +141,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Defines the name of the <code>check-bats-version</code> job stored within the <code>jobs</code> section.
|
||||
Defines a job named <code>check-bats-version</code>. The child keys will define properties of the job.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -145,7 +152,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Configures the job to run on an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub. For syntax examples using other runners, see <a href="https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on">"Workflow syntax for {% data variables.product.prodname_actions %}."</a>
|
||||
Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub. For syntax examples using other runners, see <a href="https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on">"Workflow syntax for {% data variables.product.prodname_actions %}."</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -156,7 +163,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Groups together all the steps that run in the <code>check-bats-version</code> job. Each item nested under this section is a separate action or shell command.
|
||||
Groups together all the steps that run in the <code>check-bats-version</code> job. Each item nested under this section is a separate action or shell script.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -167,7 +174,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
The <code>uses</code> keyword tells the job to retrieve <code>v2</code> of the community action named <code>actions/checkout@v2</code>. This is an action that checks out your repository and downloads it to the runner, allowing you to run actions against your code (such as testing tools). You must use the checkout action any time your workflow will run against the repository's code or you are using an action defined in the repository.
|
||||
The <code>uses</code> keyword specifies that this step will run <code>v2</code> of the <code>actions/checkout</code> action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will run against the repository's code.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -180,7 +187,7 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
This step uses the <code>actions/setup-node@v2</code> action to install the specified version of the <code>node</code> software package on the runner, which gives you access to the <code>npm</code> command.
|
||||
This step uses the <code>actions/setup-node@v2</code> action to install the specified version of the Node.js (this example uses v14). This puts both the <code>node</code> and <code>npm</code> commands in your <code>PATH</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -209,13 +216,13 @@ To help you understand how YAML syntax is used to create a workflow file, this s
|
||||
|
||||
### Visualizing the workflow file
|
||||
|
||||
In this diagram, you can see the workflow file you just created and how the {% data variables.product.prodname_actions %} components are organized in a hierarchy. Each step executes a single action or shell command. Steps 1 and 2 use prebuilt community actions. Steps 3 and 4 run shell commands directly on the runner. To find more prebuilt actions for your workflows, see "[Finding and customizing actions](/actions/learn-github-actions/finding-and-customizing-actions)."
|
||||
In this diagram, you can see the workflow file you just created and how the {% data variables.product.prodname_actions %} components are organized in a hierarchy. Each step executes a single action or shell script. Steps 1 and 2 run actions, while steps 3 and 4 run shell scripts. To find more prebuilt actions for your workflows, see "[Finding and customizing actions](/actions/learn-github-actions/finding-and-customizing-actions)."
|
||||
|
||||

|
||||
|
||||
## Viewing the job's activity
|
||||
## Viewing the workflow's activity
|
||||
|
||||
Once your job has started running, you can {% ifversion fpt or ghes > 3.0 or ghae or ghec %}see a visualization graph of the run's progress and {% endif %}view each step's activity on {% data variables.product.prodname_dotcom %}.
|
||||
Once your workflow has started running, you can {% ifversion fpt or ghes > 3.0 or ghae or ghec %}see a visualization graph of the run's progress and {% endif %}view each step's activity on {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
1. Under your repository name, click **Actions**.
|
||||
|
||||
@@ -54,6 +54,36 @@ It's not possible to add CPU or memory resources to an existing AWS/EC2 instance
|
||||
3. Start the instance.
|
||||
{% data reusables.enterprise_installation.configuration-recognized %}
|
||||
|
||||
## Adding CPU or memory resources on Microsoft Azure
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** To add CPU or memory resources in Microsoft Azure, you must be familiar with using either the Azure Portal, Azure CLI or Azure Powershell to manage VM instances. For background and details on using the Azure tools of your choice to perform the resize, please refer to the Azure documentation on [changing the size of a virtual machine](https://docs.microsoft.com/en-us/azure/virtual-machines/resize-vm).
|
||||
|
||||
{% endnote %}
|
||||
|
||||
### Resizing considerations
|
||||
|
||||
Before increasing CPU or memory resources for {% data variables.product.product_location %}, review the following recommendations.
|
||||
|
||||
- **Scale your memory with CPUs**. {% data reusables.enterprise_installation.increasing-cpus-req %}
|
||||
- **Assign a static IP address to the instance**. If you haven't assigned a static IP to your instance, you might have to adjust the DNS A records for your {% data variables.product.prodname_ghe_server %} host after the restart to account for the change in IP address.
|
||||
|
||||
### Supported Microsoft Azure instance sizes
|
||||
|
||||
You need to determine the instance size you would like to upgrade to based on CPU/memory specifications.
|
||||
|
||||
{% data reusables.enterprise_installation.warning-on-scaling %}
|
||||
|
||||
{% data reusables.enterprise_installation.azure-instance-recommendation %}
|
||||
|
||||
### Resizing for Microsoft Azure
|
||||
|
||||
You can scale the VM up by changing the VM size. Changing its size will cause it to be restarted. In some cases, you must deallocate the VM first. This can happen if the new size is not available on the hardware cluster that is currently hosting the VM.
|
||||
|
||||
1. Refer to the Azure documentation on [changing the size of a virtual machine](https://docs.microsoft.com/en-us/azure/virtual-machines/resize-vm) for the required steps.
|
||||
{% data reusables.enterprise_installation.configuration-recognized %}
|
||||
|
||||
## Adding CPU or memory resources for OpenStack KVM
|
||||
|
||||
It's not possible to add CPU or memory resources to an existing OpenStack KVM instance. Instead, you must:
|
||||
|
||||
@@ -3,7 +3,7 @@ title: GitHub Enterprise guides
|
||||
shortTitle: Guides
|
||||
intro: 'Learn how to increase developer productivity and code quality with {% data variables.product.product_name %}.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
layout: product-sublanding
|
||||
layout: product-guides
|
||||
versions:
|
||||
ghec: '*'
|
||||
ghes: '*'
|
||||
|
||||
@@ -33,11 +33,7 @@ Before launching {% data variables.product.product_location %} on Azure, you'll
|
||||
|
||||
{% data reusables.enterprise_installation.warning-on-scaling %}
|
||||
|
||||
The {% data variables.product.prodname_ghe_server %} appliance requires a premium storage data disk, and is supported on any Azure VM that supports premium storage. Azure VM types with the `s` suffix support premium storage. For more information, see "[What disk types are available in Azure?](https://docs.microsoft.com/en-us/azure/virtual-machines/disks-types#premium-ssd)" and "[Azure premium storage: design for high performance](https://docs.microsoft.com/en-us/azure/virtual-machines/premium-storage-performance)" in the Azure documentation.
|
||||
|
||||
{% data variables.product.company_short %} recommends a memory-optimized VM for {% data variables.product.prodname_ghe_server %}. For more information, see "[Memory optimized virtual machine sizes](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes-memory)" in the Azure documentation.
|
||||
|
||||
{% data variables.product.prodname_ghe_server %} supports any region that supports your VM type. For more information about the supported regions for each VM, see Azure's "[Products available by region](https://azure.microsoft.com/regions/services/)."
|
||||
{% data reusables.enterprise_installation.azure-instance-recommendation %}
|
||||
|
||||
## Creating the {% data variables.product.prodname_ghe_server %} virtual machine
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ There are several types of data that applications can request.
|
||||
| Notifications | Notification access allows applications to read your {% data variables.product.product_name %} notifications, such as comments on issues and pull requests. However, applications remain unable to access anything in your repositories. |
|
||||
| Organizations and teams | Organization and teams access allows apps to access and manage organization and team membership. |
|
||||
| Personal user data | User data includes information found in your user profile, like your name, e-mail address, and location. |
|
||||
| Repositories | Repository information includes the names of contributors, the branches you've created, and the actual files within your repository. Applications can request access for either {% ifversion not ghae %}public{% else %}internal{% endif %} or private repositories on a user-wide level. |
|
||||
| Repositories | Repository information includes the names of contributors, the branches you've created, and the actual files within your repository. An application can request access to all of your repositories of any visibility level. For more information, see "[About repositories](/repositories/creating-and-managing-repositories/about-repositories#about-repository-visibility)." |
|
||||
| Repository delete | Applications can request to delete repositories that you administer, but they won't have access to your code. |
|
||||
|
||||
## Requesting updated permissions
|
||||
|
||||
@@ -46,7 +46,6 @@ The events listed in your security log are triggered by your actions. Actions ar
|
||||
|
||||
| Category name | Description
|
||||
|------------------|-------------------{% ifversion fpt or ghec %}
|
||||
| [`account_recovery_token`](#account_recovery_token-category-actions) | Contains all activities related to [adding a recovery token](/articles/configuring-two-factor-authentication-recovery-methods).
|
||||
| [`billing`](#billing-category-actions) | Contains all activities related to your billing information.
|
||||
| [`codespaces`](#codespaces-category-actions) | Contains all activities related to {% data variables.product.prodname_codespaces %}. For more information, see "[About {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/about-codespaces)."
|
||||
| [`marketplace_agreement_signature`](#marketplace_agreement_signature-category-actions) | Contains all activities related to signing the {% data variables.product.prodname_marketplace %} Developer Agreement.
|
||||
@@ -77,14 +76,6 @@ An overview of some of the most common actions that are recorded as events in th
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
### `account_recovery_token` category actions
|
||||
|
||||
| Action | Description
|
||||
|------------------|-------------------
|
||||
| `confirm` | Triggered when you successfully [store a new token with a recovery provider](/articles/configuring-two-factor-authentication-recovery-methods).
|
||||
| `recover` | Triggered when you successfully [redeem an account recovery token](/articles/recovering-your-account-if-you-lose-your-2fa-credentials).
|
||||
| `recover_error` | Triggered when a token is used but {% data variables.product.prodname_dotcom %} is not able to validate it.
|
||||
|
||||
### `billing` category actions
|
||||
|
||||
| Action | Description
|
||||
|
||||
@@ -67,7 +67,7 @@ You can use your two-factor authentication credentials or two-factor authenticat
|
||||

|
||||
4. Click **Send one-time password** to send a one-time password to all email addresses associated with your account.
|
||||

|
||||
5. Under "One-time password", type the temporary password from the recovery email {% data variables.product.prodname_dotcom %} sent.
|
||||
5. Under "One-time password", type the temporary password from the recovery email {% data variables.product.prodname_dotcom %} sent.
|
||||

|
||||
6. Click **Verify email address**.
|
||||
7. Choose an alternative verification factor.
|
||||
@@ -77,34 +77,6 @@ You can use your two-factor authentication credentials or two-factor authenticat
|
||||

|
||||
8. A member of {% data variables.contact.github_support %} will review your request and email you within 3-5 business days. If your request is approved, you'll receive a link to complete your account recovery process. If your request is denied, the email will include a way to contact support with any additional questions.
|
||||
|
||||
## Authenticating with an account recovery token
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Warning:** Account recovery tokens are deprecated and will be disabled on **December 1st, 2021**. Please ensure you have configured other two-factor recovery methods. For more information, see "[Configuring two-factor authentication recovery methods](/articles/configuring-two-factor-authentication-recovery-methods)."
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
If you lose access to the two-factor authentication methods for your account on {% data variables.product.product_location %}, you can retrieve your account recovery token from a partner recovery provider and ask {% data variables.product.prodname_dotcom %} Support to review it.
|
||||
|
||||
If you don't have access to your two-factor authentication methods or recovery codes and you've stored an account recovery token with Facebook using Recover Accounts Elsewhere, you may be able to use your token to regain access to your account.
|
||||
|
||||
If you're unable to regain access to your account, generate a one-time password to regain access. For more information, see "[Authenticating with a verified device, SSH token, or personal access token](#authenticating-with-a-verified-device-ssh-token-or-personal-access-token)."
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Warnings:**
|
||||
- Before you retrieve an account recovery token, you should try using your [two-factor authentication codes](/articles/accessing-github-using-two-factor-authentication) or your two-factor authentication recovery codes to regain access to your account. For more information, see "[Recovering your account if you lose your 2FA credentials](/articles/recovering-your-account-if-you-lose-your-2fa-credentials)."
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
1. On Facebook, navigate to your [Security Settings](https://www.facebook.com/settings?tab=security), then click **Recover Accounts Elsewhere**.
|
||||

|
||||
2. Click the recovery token associated with your account on {% data variables.product.product_location %}.
|
||||

|
||||
3. To redeem your account recovery token, click **Recover This Account**. A new window will open, returning you to {% data variables.product.product_name %}.
|
||||

|
||||
4. Contact {% data variables.contact.contact_support %} to let them know that your account recovery token is ready for review.
|
||||
{% endif %}
|
||||
|
||||
## Further reading
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Guides for code security
|
||||
intro: 'Learn about the different ways that {% data variables.product.product_name %} can help you improve your code''s security.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
layout: product-sublanding
|
||||
layout: product-guides
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
|
||||
@@ -27,7 +27,7 @@ You can use the security overview for a high-level view of the security status o
|
||||
|
||||
The security overview indicates whether {% ifversion fpt or ghes > 3.1 or ghec %}security{% endif %}{% ifversion ghae-next %}{% data variables.product.prodname_GH_advanced_security %}{% endif %} features are enabled for repositories owned by your organization and consolidates alerts for each feature.{% ifversion fpt or ghes > 3.1 or ghec %} Security features include {% data variables.product.prodname_GH_advanced_security %} features, such as {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_secret_scanning %}, as well as {% data variables.product.prodname_dependabot_alerts %}.{% endif %} For more information about {% data variables.product.prodname_GH_advanced_security %} features, see "[About {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)."{% ifversion fpt or ghes > 3.1 or ghec %} For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)."{% endif %}
|
||||
|
||||
For more information about securing your code at the repository and organization levels, see "[Securing your repository](/code-security/getting-started/securing-your-repository)" and "[Securing your organization](/code-security/getting-started/securing-your-organization)."
|
||||
For more information about securing your code at the repository and organization levels, see "[Securing your repository](/code-security/getting-started/securing-your-repository)" and "[Securing your organization](/code-security/getting-started/securing-your-organization)."
|
||||
|
||||
In the security overview, you can view, sort, and filter alerts to understand the security risks in your organization and in specific repositories. You can apply multiple filters to focus on areas of interest. For example, you can identify private repositories that have a high number of {% data variables.product.prodname_dependabot_alerts %} or repositories that have no {% data variables.product.prodname_code_scanning %} alerts.
|
||||
|
||||
@@ -105,11 +105,15 @@ The level of risk for a repository is determined by the number and severity of a
|
||||
### Filter by repository type
|
||||
|
||||
| Qualifier | Description |
|
||||
| -------- | -------- |{% ifversion fpt or ghes > 3.1 or ghec %}
|
||||
| `is:public` | Display public repositories. |{% endif %}
|
||||
| -------- | -------- |
|
||||
{%- ifversion fpt or ghes > 3.1 or ghec %}
|
||||
| `is:public` | Display public repositories. |
|
||||
{% elsif ghes or ghec or ghae %}
|
||||
| `is:internal` | Display internal repositories. |
|
||||
{%- endif %}
|
||||
| `is:private` | Display private repositories. |
|
||||
| `archived:true` | Display archived repositories. |
|
||||
| `archived:true` | Display archived repositories. |
|
||||
|
||||
### Filter by team
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ children:
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
- /setting-your-timeout-period-for-codespaces
|
||||
- /prebuilding-codespaces-for-your-project
|
||||
---
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ shortTitle: Personalize your codespaces
|
||||
When using any development environment, customizing the settings and tools to your preferences and workflows is an important step. {% data variables.product.prodname_codespaces %} allows for two main ways of personalizing your codespaces.
|
||||
|
||||
- [Settings Sync](#settings-sync) - You can use and share {% data variables.product.prodname_vscode %} settings between {% data variables.product.prodname_codespaces %} and other instances of {% data variables.product.prodname_vscode %}.
|
||||
- [Dotfiles](#dotfiles) – You can use a public `dotfiles` repository to specify scripts, shell preferences, and other configurations.
|
||||
- [Dotfiles](#dotfiles) – You can use a `dotfiles` repository to specify scripts, shell preferences, and other configurations.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} personalization applies to any codespace you create.
|
||||
|
||||
@@ -33,7 +33,7 @@ Project maintainers can also define a default configuration that applies to ever
|
||||
|
||||
Settings Sync allows you to share configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state across machines and instances of {% data variables.product.prodname_vscode %}.
|
||||
|
||||
To enable Settings Sync, in the bottom-left corner of the Activity Bar, select {% octicon "gear" aria-label="The gear icon" %} and click **Turn on Settings Sync…**. From the dialog, select which settings you'd like to sync.
|
||||
To enable Settings Sync, in the bottom-left corner of the Activity Bar, select {% octicon "gear" aria-label="The gear icon" %} and click **Turn on Settings Sync…**. In the dialog box, select the settings you'd like to sync.
|
||||
|
||||

|
||||
|
||||
@@ -41,13 +41,13 @@ For more information, see the [Settings Sync guide](https://code.visualstudio.co
|
||||
|
||||
## Dotfiles
|
||||
|
||||
Dotfiles are files and folders on Unix-like systems starting with `.` that control the configuration of applications and shells on your system. You can store and manage your dotfiles in a repository on {% data variables.product.prodname_dotcom %}. For advice and tutorials about what to include in your `dotfiles` repository, see [GitHub does dotfiles](https://dotfiles.github.io/).
|
||||
Dotfiles are files and folders on Unix-like systems starting with `.` that control the configuration of applications and shells on your system. You can store and manage your dotfiles in a repository on {% data variables.product.prodname_dotcom %}. For advice and tutorials about what to include in your dotfiles repository, see [GitHub does dotfiles](https://dotfiles.github.io/).
|
||||
|
||||
If your user account on {% data variables.product.prodname_dotcom %} owns a public repository named `dotfiles`, {% data variables.product.prodname_dotcom %} can automatically use this repository to personalize your codespace environment, once enabled from your [personal Codespaces settings](https://github.com/settings/codespaces). Private `dotfiles` repositories are not currently supported.
|
||||
Your dotfiles repository might include your shell aliases and preferences, any tools you want to install, or any other codespace personalization you want to make.
|
||||
|
||||
Your `dotfiles` repository might include your shell aliases and preferences, any tools you want to install, or any other codespace personalization you want to make.
|
||||
You can configure {% data variables.product.prodname_codespaces %} to use dotfiles from any repository you own by selecting that repository in your [personal {% data variables.product.prodname_codespaces %} settings](https://github.com/settings/codespaces).
|
||||
|
||||
When you create a new codespace, {% data variables.product.prodname_dotcom %} clones your `dotfiles` repository to the codespace environment, and looks for one of the following files to set up the environment.
|
||||
When you create a new codespace, {% data variables.product.prodname_dotcom %} clones your selected repository to the codespace environment, and looks for one of the following files to set up the environment.
|
||||
|
||||
* _install.sh_
|
||||
* _install_
|
||||
@@ -58,9 +58,9 @@ When you create a new codespace, {% data variables.product.prodname_dotcom %} cl
|
||||
* _setup_
|
||||
* _script/setup_
|
||||
|
||||
If none of these files are found, then any files or folders in `dotfiles` starting with `.` are symlinked to the codespace's `~` or `$HOME` directory.
|
||||
If none of these files are found, then any files or folders in your selected dotfiles repository starting with `.` are symlinked to the codespace's `~` or `$HOME` directory.
|
||||
|
||||
Any changes to your `dotfiles` repository will apply only to each new codespace, and do not affect any existing codespace.
|
||||
Any changes to your selected dotfiles repository will apply only to each new codespace, and do not affect any existing codespace.
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -70,18 +70,20 @@ Any changes to your `dotfiles` repository will apply only to each new codespace,
|
||||
|
||||
### Enabling your dotfiles repository for {% data variables.product.prodname_codespaces %}
|
||||
|
||||
You can use your public `dotfiles` repository to personalize your {% data variables.product.prodname_codespaces %} environment. Once you set up that repository, you can add your scripts, preferences, and configurations to it. You then need to enable your dotfiles from your personal {% data variables.product.prodname_codespaces %} settings page.
|
||||
You can use your selected dotfiles repository to personalize your {% data variables.product.prodname_codespaces %} environment. Once you choose your dotfiles repository, you can add your scripts, preferences, and configurations to it. You then need to enable your dotfiles from your personal {% data variables.product.prodname_codespaces %} settings page.
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Warning:** Dotfiles have the ability to run arbitrary scripts, which may contain unexpected or malicious code. Before installing a dotfiles repo, we recommend checking scripts to ensure they don't perform any unexpected actions.
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
{% data reusables.user_settings.access_settings %}
|
||||
{% data reusables.user_settings.codespaces-tab %}
|
||||
1. Under "Dotfiles", select "Automatically install dotfiles" so that {% data variables.product.prodname_codespaces %} automatically installs your dotfiles into every new codespace you create.
|
||||

|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** This option is only available if you've created a public `dotfiles` repository for your user account.
|
||||
|
||||
{% endnote %}
|
||||
1. Under "Dotfiles", select **Automatically install dotfiles** so that {% data variables.product.prodname_codespaces %} automatically installs your dotfiles into every new codespace you create.
|
||||

|
||||
2. Choose the repository you want to install dotfiles from.
|
||||

|
||||
|
||||
You can add further script, preferences, configuration files to your dotfiles repository or edit existing files whenever you want. Changes to settings will only be picked up by new codespaces.
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Setting your timeout period for Codespaces
|
||||
intro: 'You can set your default timeout for {% data variables.product.prodname_codespaces %} in your personal settings page.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Codespaces
|
||||
shortTitle: Set the timeout
|
||||
---
|
||||
|
||||
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Warning**: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
## Setting your default timeout
|
||||
|
||||
{% include tool-switcher %}
|
||||
|
||||
{% webui %}
|
||||
|
||||
{% data reusables.user_settings.access_settings %}
|
||||
{% data reusables.user_settings.codespaces-tab %}
|
||||
1. Under "Default idle timeout", enter the time that you want, then click **Save**. The time must be between 5 minutes and 240 minutes (4 hours).
|
||||

|
||||
|
||||
{% endwebui %}
|
||||
|
||||
{% cli %}
|
||||
|
||||
{% data reusables.cli.cli-learn-more %}
|
||||
|
||||
To set the timeout period, use the `idle-timeout` argument with the `codespace create` subcommand. Specify the time in minutes, followed by `m`. The time must be between 5 minutes and 240 minutes (5 hours).
|
||||
|
||||
```shell
|
||||
gh codespace create --idle-timeout 90m
|
||||
```
|
||||
|
||||
If you do not specify a timeout period when creating a codespace, then your default timeout period will be used. You cannot currently specify a default timeout period for all future codespaces through {% data variables.product.prodname_cli %}.
|
||||
|
||||
{% endcli %}
|
||||
@@ -33,7 +33,7 @@ If you have unsaved changes, your editor will prompt you to save them before exi
|
||||
|
||||
## Codespaces timeouts
|
||||
|
||||
If you leave your codespace running without interaction or if you exit your codespace without explicitly stopping it, the codespace will timeout after 30 minutes of inactivity and stop running. For more information, see "[Stopping a codespace](#stopping-a-codespace)."
|
||||
If you leave your codespace running without interaction, or if you exit your codespace without explicitly stopping it, the codespace will timeout after a period of inactivity and stop running. By default, a codespace will timeout after 30 minutes of inactivity, but you can customize the duration of the timeout period for new codespaces that you create. For more information about setting the default timeout period for your codespaces, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." For more information about stopping a codespace, see "[Stopping a codespace](#stopping-a-codespace)."
|
||||
|
||||
When a codespace times out, your data is preserved from the last time your changes were saved. For more information, see "[Saving changes in a codespace](#saving-changes-in-a-codespace)."
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ shortTitle: Guides
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
intro: Learn how to make the most of GitHub
|
||||
allowTitleToDifferFromFilename: true
|
||||
layout: product-sublanding
|
||||
layout: product-guides
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
|
||||