Skip to content

Commit 8b101bd

Browse files
authored
Merge branch 'main' into document-npm-run-build
2 parents f8b5a2c + b1dc16d commit 8b101bd

File tree

72 files changed

+298
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+298
-184
lines changed

.github/workflows/js-lint.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Lint JS
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches-ignore:
10+
- translations
11+
12+
jobs:
13+
see_if_should_skip:
14+
runs-on: ubuntu-latest
15+
16+
outputs:
17+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
18+
steps:
19+
- id: skip_check
20+
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
21+
with:
22+
cancel_others: 'false'
23+
github_token: ${{ github.token }}
24+
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml"]'
25+
26+
lint:
27+
runs-on: ubuntu-latest
28+
needs: see_if_should_skip
29+
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
30+
steps:
31+
- name: Check out repo
32+
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
33+
34+
- name: Setup node
35+
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
36+
with:
37+
node-version: 14.x
38+
39+
- name: Get npm cache directory
40+
id: npm-cache
41+
run: |
42+
echo "::set-output name=dir::$(npm config get cache)"
43+
44+
- name: Cache node modules
45+
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
46+
with:
47+
path: ${{ steps.npm-cache.outputs.dir }}
48+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
49+
restore-keys: |
50+
${{ runner.os }}-node-
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Run linter
56+
run: npx standard
57+
58+
- name: Check dependencies
59+
run: npm run check-deps

.github/workflows/test.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,7 @@ jobs:
2828
cancel_others: 'false'
2929
github_token: ${{ github.token }}
3030
paths: '[".github/workflows/test.yml",".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
31-
lint:
32-
needs: see_if_should_skip
33-
runs-on: ubuntu-latest
34-
steps:
35-
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
36-
# Even if if doesn't do anything
37-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
38-
name: Check out repo
39-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
40-
41-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
42-
name: Setup node
43-
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
44-
with:
45-
node-version: 14.x
46-
47-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
48-
name: Get npm cache directory
49-
id: npm-cache
50-
run: |
51-
echo "::set-output name=dir::$(npm config get cache)"
52-
53-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
54-
name: Cache node modules
55-
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
56-
with:
57-
path: ${{ steps.npm-cache.outputs.dir }}
58-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
59-
restore-keys: |
60-
${{ runner.os }}-node-
6131

62-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
63-
name: Install dependencies
64-
run: npm ci
65-
66-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
67-
name: Run linter
68-
run: npx standard
69-
70-
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
71-
name: Check dependencies
72-
run: npm run check-deps
7332
test:
7433
needs: see_if_should_skip
7534
runs-on: ubuntu-latest

.github/workflows/triage-issue-comments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
triage-issue-comments:
8-
if: github.repository == 'github/docs'
8+
if: github.repository == 'github/docs' && github.event.issue.pull_request == null
99
runs-on: ubuntu-latest
1010

1111
steps:

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and
8989
When we merge those changes, they should be deployed to the live site within 24 hours. :earth_africa: To learn more about opening a pull request in this repo, see [Opening a pull request](#opening-a-pull-request) below.
9090

9191
### :question: Support
92-
We are a small team working hard to keep up with the documentation demands of a continously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
92+
We are a small team working hard to keep up with the documentation demands of a continuously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
9393

9494
If you're having trouble with your GitHub account, contact [Support](https://support.github.com/contact).
9595

@@ -129,7 +129,7 @@ Here's some information that might be helpful while working on a Docs PR:
129129

130130
- [Variables](/data/variables/README.md) - We use variables the same way we use reusables. Variables are for short strings of reusable text.
131131

132-
- [Liquid](/contribution/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
132+
- [Liquid](/contributing/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
133133

134134
- [Scripts](/script/README.md) - The scripts directory is the home for all of the scripts you can run locally.
135135

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you've found a problem, you can open an issue using a [template](https://gith
2727

2828
#### Solve an issue
2929

30-
If you have a solution to one of the open issues, you will need to fork the repository and submit a PR using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
30+
If you have a solution to one of the open issues, you will need to fork the repository and submit a PR using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
3131

3232
#### Join us in discussions
3333

assets/images/actions-log-group.png

4.88 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/actions/guides/building-and-testing-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This guide shows you how to use PowerShell for CI. It describes how to use Peste
2121
You should be familiar with YAML and the syntax for {% data variables.product.prodname_actions %}. For more information, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)."
2222

2323
We recommend that you have a basic understanding of PowerShell and Pester. For more information, see:
24-
- [Getting started with PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started)
24+
- [Getting started with PowerShell](https://docs.microsoft.com/powershell/scripting/learn/ps101/01-getting-started)
2525
- [Pester](https://pester.dev)
2626

2727
{% data reusables.actions.enterprise-setup-prereq %}
@@ -85,7 +85,7 @@ The table below describes the locations for various PowerShell modules in each {
8585
8686
{% note %}
8787
88-
**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce signficant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`.
88+
**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce significant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`.
8989
9090
{% endnote %}
9191

content/actions/guides/storing-workflow-data-as-artifacts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ Jobs that are dependent on a previous job's artifacts must wait for the dependen
171171

172172
Job 1 performs these steps:
173173
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
174-
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the name `homework`. The action places the file in a directory named `homework`.
174+
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework`.
175175

176176
Job 2 uses the result in the previous job:
177177
- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
178-
- Reads the value in the `homework/math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt`.
179-
- Uploads the `math-homework.txt` file. This upload overwrites the previous upload because both of the uploads share the same name.
178+
- Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents.
179+
- Uploads the `math-homework.txt` file. This upload overwrites the previously uploaded artifact because they share the same name.
180180

181181
Job 3 displays the result uploaded in the previous job:
182182
- Downloads the `homework` artifact.

content/actions/hosting-your-own-runners/about-self-hosted-runners.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ You must ensure that the machine has the appropriate network access to communica
111111
github.com
112112
api.github.com
113113
*.actions.githubusercontent.com
114+
codeload.github.com
114115
```
115116

116117
If you use an IP address allow list for your {% data variables.product.prodname_dotcom %} organization or enterprise account, you must add your self-hosted runner's IP address to the allow list. For more information, see "[Managing allowed IP addresses for your organization](/github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list)" or "[Enforcing security settings in your enterprise account](/github/setting-up-and-managing-your-enterprise/enforcing-security-settings-in-your-enterprise-account#using-github-actions-with-an-ip-allow-list)".

content/actions/learn-github-actions/migrating-from-azure-pipelines-to-github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Jobs and steps in Azure Pipelines are very similar to jobs and steps in {% data
4141

4242
### Migrating script steps
4343

44-
You can run a script or a shell command as a step in a workflow. In Azure Pipelines, script steps can be specified using the `script` key, or with the `bash`, `powershell`, or `pwsh` keys. Scripts can also be specified as an input to the [Bash task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/bash?view=azure-devops) or the [PowerShell task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops).
44+
You can run a script or a shell command as a step in a workflow. In Azure Pipelines, script steps can be specified using the `script` key, or with the `bash`, `powershell`, or `pwsh` keys. Scripts can also be specified as an input to the [Bash task](https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash?view=azure-devops) or the [PowerShell task](https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops).
4545

4646
In {% data variables.product.prodname_actions %}, all scripts are specified using the `run` key. To select a particular shell, you can specify the `shell` key when providing the script. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun)."
4747

content/actions/learn-github-actions/migrating-from-gitlab-cicd-to-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ GitLab CI/CD
180180
deploy_prod:
181181
stage: deploy
182182
script:
183-
- echo "Deply to production server"
183+
- echo "Deploy to production server"
184184
rules:
185185
- if: '$CI_COMMIT_BRANCH == "master"'
186186
```
@@ -194,7 +194,7 @@ jobs:
194194
if: contains( github.ref, 'master')
195195
runs-on: ubuntu-latest
196196
steps:
197-
- run: echo "Deply to production server"
197+
- run: echo "Deploy to production server"
198198
```
199199
{% endraw %}
200200
</td>

content/actions/learn-github-actions/security-hardening-for-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Secrets use [Libsodium sealed boxes](https://libsodium.gitbook.io/doc/public-key
2626
To help prevent accidental disclosure, {% data variables.product.product_name %} uses a mechanism that attempts to redact any secrets that appear in run logs. This redaction looks for exact matches of any configured secrets, as well as common encodings of the values, such as Base64. However, because there are multiple ways a secret value can be transformed, this redaction is not guaranteed. As a result, there are certain proactive steps and good practices you should follow to help ensure secrets are redacted, and to limit other risks associated with secrets:
2727

2828
- **Never use structured data as a secret**
29-
- Unstructured data can cause secret redaction within logs to fail, because redaction largely relies on finding an exact match for the specific secret value. For example, do not use a blob of JSON, XML, or YAML (or similar) to encapsulate a secret value, as this significantly reduces the probability the secrets will be properly redacted. Instead, create individual secrets for each sensitive value.
29+
- Structured data can cause secret redaction within logs to fail, because redaction largely relies on finding an exact match for the specific secret value. For example, do not use a blob of JSON, XML, or YAML (or similar) to encapsulate a secret value, as this significantly reduces the probability the secrets will be properly redacted. Instead, create individual secrets for each sensitive value.
3030
- **Register all secrets used within workflows**
3131
- If a secret is used to generate another sensitive value within a workflow, that generated value should be formally [registered as a secret](https://github.com/actions/toolkit/tree/main/packages/core#setting-a-secret), so that it will be redacted if it ever appears in the logs. For example, if using a private key to generate a signed JWT to access a web API, be sure to register that JWT as a secret or else it won’t be redacted if it ever enters the log output.
3232
- Registering secrets applies to any sort of transformation/encoding as well. If your secret is transformed in some way (such as Base64 or URL-encoded), be sure to register the new value as a secret too.
@@ -98,7 +98,7 @@ You should also consider the environment of the self-hosted runner machines:
9898

9999
### Auditing {% data variables.product.prodname_actions %} events
100100

101-
You can use the audit log to monitor administrative tasks in an organization. The audit log records the type of action, when it was run, and which user account perfomed the action.
101+
You can use the audit log to monitor administrative tasks in an organization. The audit log records the type of action, when it was run, and which user account performed the action.
102102

103103
For example, you can use the audit log to track the `action:org.update_actions_secret` event, which tracks changes to organization secrets:
104104
![Audit log entries](/assets/images/help/repository/audit-log-entries.png)

content/actions/reference/encrypted-secrets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ steps:
106106
```
107107
{% endraw %}
108108
109-
Avoid passing secrets between processes from the command line, whenever possible. Command-line processes may be visible to other users (using the `ps` command) or captured by [security audit events](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing). To help protect secrets, consider using environment variables, `STDIN`, or other mechanisms supported by the target process.
109+
Avoid passing secrets between processes from the command line, whenever possible. Command-line processes may be visible to other users (using the `ps` command) or captured by [security audit events](https://docs.microsoft.com/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing). To help protect secrets, consider using environment variables, `STDIN`, or other mechanisms supported by the target process.
110110

111111
If you must pass secrets within a command line, then enclose them within the proper quoting rules. Secrets often contain special characters that may unintentionally affect your shell. To escape these special characters, use quoting with your environment variables. For example:
112112

content/actions/reference/events-that-trigger-workflows.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You can manually trigger a workflow run using the {% data variables.product.prod
100100

101101
##### Example workflow configuration
102102

103-
This example defines the `name` and `home` inputs and prints them using the `github.event.inputs.name` and `github.event.inputs.home` contexts. If a `name` isn't provided, the default value 'Mona the Octocat' is printed.
103+
This example defines the `name` and `home` inputs and prints them using the `github.event.inputs.name` and `github.event.inputs.home` contexts. If a `home` isn't provided, the default value 'The Octoverse' is printed.
104104

105105
{% raw %}
106106
```yaml
@@ -115,6 +115,7 @@ on:
115115
home:
116116
description: 'location'
117117
required: false
118+
default: 'The Octoverse'
118119

119120
jobs:
120121
say_hello:
@@ -314,6 +315,33 @@ on:
314315
types: [created, deleted]
315316
```
316317

318+
The `issue_comment` event occurs for comments on both issues and pull requests. To determine whether the `issue_comment` event was triggered from an issue or pull request, you can check the event payload for the `issue.pull_request` property and use it as a condition to skip a job.
319+
320+
For example, you can choose to run the `pr_commented` job when comment events occur in a pull request, and the `issue_commented` job when comment events occur in an issue.
321+
322+
```yaml
323+
on: issue_comment
324+
325+
jobs:
326+
pr_commented:
327+
# This job only runs for pull request comments
328+
name: PR comment
329+
if: ${{ github.event.issue.pull_request }}
330+
runs-on: ubuntu-latest
331+
steps:
332+
- run: |
333+
echo "Comment on PR #${{ github.event.issue.number }}"
334+
335+
issue-commented:
336+
# This job only runs for issue comments
337+
name: Issue comment
338+
if: ${{ !github.event.issue.pull_request }}
339+
runs-on: ubuntu-latest
340+
steps:
341+
- run: |
342+
echo "Comment on issue #${{ github.event.issue.number }}"
343+
```
344+
317345
#### `issues`
318346

319347
Runs your workflow anytime the `issues` event occurs. {% data reusables.developer-site.multiple_activity_types %} For information about the REST API, see "[Issues](/v3/issues)."
@@ -655,6 +683,10 @@ on:
655683

656684
{% data reusables.webhooks.workflow_run_desc %}
657685

686+
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
687+
| --------------------- | -------------- | ------------ | -------------|
688+
| [`workflow_run`](/webhooks/event-payloads/#workflow_run) | - n/a | Last commit on default branch | Default branch |
689+
658690
If you need to filter branches from this event, you can use `branches` or `branches-ignore`.
659691

660692
In this example, a workflow is configured to run after the separate “Run Tests” workflow completes.

0 commit comments

Comments
 (0)