Skip to content

Commit d9167f1

Browse files
nschonnihubwriter
andauthored
chore: Add missing code fence languages (#772)
* chore: Add missing code fence languages * Update content/actions/creating-actions/dockerfile-support-for-github-actions.md * Add raw & endraw markers around shell content See review comment by @rachmari * Add raw & endraw markers around shell content See review comment by @rachmari * Remove language from code fences to avoid the problem of replaceable text indicates like <this> not showing up in the output page. Co-authored-by: hubwriter <[email protected]>
1 parent b9df88a commit d9167f1

File tree

36 files changed

+132
-119
lines changed

36 files changed

+132
-119
lines changed

content/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ https://github-images.s3.amazonaws.com/enterprise/2.20/assets/images/help/profil
269269

270270
Sometimes you want to link to a Dotcom-only article in Enterprise content and you don't want the link to be Enterprise-ified. To prevent the transformation, write the link using HTML and add a class of `dotcom-only`. For example:
271271

272-
```
272+
```html
273273
<a href="/github/site-policy/github-terms-of-service" class="dotcom-only">GitHub's Terms of Service</a>
274274
```
275275

content/actions/creating-actions/dockerfile-support-for-github-actions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@ The Docker `ENTRYPOINT` instruction has a _shell_ form and _exec_ form. The Dock
4848

4949
If you configure your container to use the _exec_ form of the `ENTRYPOINT` instruction, the `args` configured in the action's metadata file won't run in a command shell. If the action's `args` contain an environment variable, the variable will not be substituted. For example, using the following _exec_ format will not print the value stored in `$GITHUB_SHA`, but will instead print `"$GITHUB_SHA"`.
5050

51-
```
51+
```dockerfile
5252
ENTRYPOINT ["echo $GITHUB_SHA"]
5353
```
5454

5555
If you want variable substitution, then either use the _shell_ form or execute a shell directly. For example, using the following _exec_ format, you can execute a shell to print the value stored in the `GITHUB_SHA` environment variable.
5656

57-
```
57+
```dockerfile
5858
ENTRYPOINT ["sh", "-c", "echo $GITHUB_SHA"]
59-
````
59+
```
6060

6161
To supply `args` defined in the action's metadata file to a Docker container that uses the _exec_ form in the `ENTRYPOINT`, we recommend creating a shell script called `entrypoint.sh` that you call from the `ENTRYPOINT` instruction:
6262

6363
##### Example *Dockerfile*
64-
```
64+
65+
```dockerfile
6566
# Container image that runs your code
6667
FROM debian:9.5-slim
6768

content/actions/creating-actions/setting-exit-codes-for-actions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ For more information, see "[Creating a JavaScript action](/articles/creating-a-j
4141

4242
If you are creating a Docker container action, you can set a failure exit code in your `entrypoint.sh` script. For example:
4343

44+
{% raw %}
4445
```
4546
if <condition> ; then
4647
echo "Game over!"
4748
exit 1
4849
fi
4950
```
51+
{% endraw %}
5052

5153
For more information, see "[Creating a Docker container action](/articles/creating-a-docker-container-action)."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ steps:
220220

221221
The example above creates an *.npmrc* file with the following contents:
222222

223-
```
223+
```ini
224224
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
225225
@octocat:registry=https://registry.npmjs.org/
226226
always-auth=true

content/actions/guides/caching-dependencies-to-speed-up-workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ A cache key can include any of the contexts, functions, literals, and operators
124124
Using expressions to create a `key` allows you to automatically create a new cache when dependencies have changed. For example, you can create a `key` using an expression that calculates the hash of an npm `package-lock.json` file.
125125

126126
{% raw %}
127-
```
127+
```yaml
128128
npm-${{ hashFiles('package-lock.json') }}
129129
```
130130
{% endraw %}
131131

132132
{% data variables.product.prodname_dotcom %} evaluates the expression `hash "package-lock.json"` to derive the final `key`.
133133

134-
```
134+
```yaml
135135
npm-d5ea0750
136136
```
137137

@@ -144,7 +144,7 @@ You can provide a list of restore keys to use when there is a cache miss on `key
144144
#### Example using multiple restore keys
145145

146146
{% raw %}
147-
```
147+
```yaml
148148
restore-keys: |
149149
npm-foobar-${{ hashFiles('package-lock.json') }}
150150
npm-foobar-
@@ -155,7 +155,7 @@ restore-keys: |
155155
The runner evaluates the expressions, which resolve to these `restore-keys`:
156156

157157
{% raw %}
158-
```
158+
```yaml
159159
restore-keys: |
160160
npm-foobar-d5ea0750
161161
npm-foobar-

content/actions/guides/publishing-nodejs-packages.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
In the example above, the `setup-node` action creates an *.npmrc* file on the runner with the following contents:
8080

81-
```
81+
```ini
8282
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
8383
registry=https://registry.npmjs.org/
8484
always-auth=true
@@ -140,7 +140,7 @@ jobs:
140140

141141
The `setup-node` action creates an *.npmrc* file on the runner. When you use the `scope` input to the `setup-node` action, the *.npmrc* file includes the scope prefix. By default, the `setup-node` action sets the scope in the *.npmrc* file to the account that contains that workflow file.
142142

143-
```
143+
```ini
144144
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
145145
@octocat:registry=https://npm.pkg.github.com
146146
always-auth=true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
115115
You can define a custom retention period for individual artifacts created by a workflow. When using a workflow to create a new artifact, you can use `retention-days` with the `upload-artifact` action. This example demonstrates how to set a custom retention period of 5 days for the artifact named `my-artifact`:
116116

117-
```
117+
```yaml
118118
- name: 'Upload Artifact'
119119
uses: actions/upload-artifact@v2
120120
with:

content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If setting environment variables is not practical, you can set the proxy configu
3838

3939
An example _.env_ proxy configuration is shown below:
4040

41-
```
41+
```ini
4242
https_proxy=http://proxy.local:8080
4343
no_proxy=example.com,myserver.local:443
4444
```

content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,30 @@ https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_FILE_PATH>/badge.svg
3434

3535
This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
3636

37-
```
37+
```markdown
3838
![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg)
3939
```
4040

4141
### Using a workflow file path
4242

4343
This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
4444

45-
```
45+
```markdown
4646
![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg)
4747
```
4848

4949
### Using the `branch` parameter
5050

5151
This Markdown example adds a status badge for a branch with the name `feature-1`.
5252

53-
```
53+
```markdown
5454
![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1)
5555
```
5656

5757
### Using the `event` parameter
5858

5959
This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event.
6060

61-
```
61+
```markdown
6262
![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request)
6363
```

content/actions/reference/workflow-commands-for-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ During the execution of a workflow, the runner generates temporary files that ca
253253

254254
**Warning:** Powershell does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path:
255255

256-
```
256+
```yaml
257257
steps:
258258
- run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
259259
```
@@ -287,7 +287,7 @@ For multiline strings, you may use a delimiter with the following syntax.
287287
##### Example
288288
289289
In this example, we use `EOF` as a delimiter and set the `JSON_RESPONSE` environment variable to the value of the curl response.
290-
```
290+
```yaml
291291
steps:
292292
- name: Set the value
293293
id: step_one

content/admin/enterprise-management/evacuating-a-cluster-node.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,46 @@ If you're taking a node offline that has any data services (like git, pages, or
1818
$ ghe-config cluster._hostname_.uuid
1919
```
2020
21-
2. You'll need to monitor the status of your node while the data is being copied. Ideally, the node shouldn't be taken offline until the copying is complete. To monitor the status of your node, run any of the following commands:
21+
2. You'll need to monitor the status of your node while the data is being copied. Ideally, the node shouldn't be taken offline until the copying is complete. To monitor the status of your node, run any of the following commands:
2222
2323
For Git
2424
```
2525
ghe-spokes evac-status
2626
```
2727
For {% data variables.product.prodname_pages %}
28+
{% raw %}
2829
```
2930
echo "select count(*) from pages_replicas where host = 'pages-server-<uuid>'" | ghe-dbconsole -y
3031
```
32+
{% endraw %}
3133
For storage
3234
```
3335
ghe-storage evacuation-status
3436
```
3537
36-
3. After the copying is complete, you can evacuate the storage service. Run any of the following commands:
38+
3. After the copying is complete, you can evacuate the storage service. Run any of the following commands:
3739
3840
For Git
41+
{% raw %}
3942
```
4043
ghe-spokes server evacuate git-server-<uuid>
4144
```
45+
{% endraw %}
4246
For {% data variables.product.prodname_pages %}
47+
{% raw %}
4348
```
4449
ghe-dpages evacuate pages-server-<uuid>
4550
```
51+
{% endraw %}
4652
For storage, take the node offline
53+
{% raw %}
4754
```
4855
ghe-storage offline storage-server-<uuid>
4956
```
57+
{% endraw %}
5058
then evacuate
59+
{% raw %}
5160
```
5261
ghe-storage evacuate storage-server-<uuid>
5362
```
63+
{% endraw %}

content/admin/enterprise-management/initializing-the-cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The names of the nodes can be any valid hostname you choose. The names are set a
4646

4747
Specify the first cluster node you configured as the MySQL primary via `mysql-server` and `mysql-master`.
4848

49-
```
49+
```ini
5050
[cluster]
5151
mysql-master = ghe-data-node-1
5252
redis-master = ghe-data-node-1

content/admin/github-actions/manually-syncing-actions-from-githubcom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This example demonstrates using the `actions-sync` tool to sync an individual ac
6363
* You can sync multiple actions by replacing the `--repo-name` parameter with `--repo-name-list` or `--repo-name-list-file`. For more information, see the [`actions-sync` README](https://github.com/actions/actions-sync#actions-sync).
6464
1. After the action repository is created on your enterprise instance, people in your enterprise can use the destination repository to reference the action in their workflows. For the example action shown above:
6565

66-
```
66+
```yaml
6767
uses: synced-actions/docker-build-push-action@v1
6868
```
6969

content/admin/policies/creating-a-pre-receive-hook-script.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ versions:
1111
You can see examples of pre-receive hooks for {% data variables.product.prodname_ghe_server %} in the [`github/platform-samples` repository](https://github.com/github/platform-samples/tree/master/pre-receive-hooks).
1212

1313
### Writing a pre-receive hook script
14-
A pre-receive hook script executes in a pre-receive hook environment on the {% data variables.product.prodname_ghe_server %} appliance. When you create a pre-receive hook script, consider the available input, output, exit-status and environment variables.
14+
A pre-receive hook script executes in a pre-receive hook environment on the {% data variables.product.prodname_ghe_server %} appliance. When you create a pre-receive hook script, consider the available input, output, exit-status and environment variables.
1515

1616
#### Input (stdin)
1717
After a push occurs and before any refs are updated on the remote repository, the `git-receive-pack` process invokes the pre-receive hook script with the standard input of one line per ref to be updated:
@@ -94,30 +94,30 @@ You can test a pre-receive hook script locally before you create or update it on
9494

9595
2. Create a file called `Dockerfile.dev` containing:
9696

97-
```
98-
FROM gliderlabs/alpine:3.3
99-
RUN \
100-
apk add --no-cache git openssh bash && \
101-
ssh-keygen -A && \
102-
sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && \
103-
adduser git -D -G root -h /home/git -s /bin/bash && \
104-
passwd -d git && \
105-
su git -c "mkdir /home/git/.ssh && \
106-
ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \
107-
mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \
108-
mkdir /home/git/test.git && \
109-
git --bare init /home/git/test.git"
110-
111-
VOLUME ["/home/git/.ssh", "/home/git/test.git/hooks"]
112-
WORKDIR /home/git
113-
114-
CMD ["/usr/sbin/sshd", "-D"]
115-
```
116-
117-
3. Create a test pre-receive script called `always_reject.sh`. This example script will reject all pushes, which is useful for locking a repository:
118-
119-
```
120-
#!/usr/bin/env bash
97+
```dockerfile
98+
FROM gliderlabs/alpine:3.3
99+
RUN \
100+
apk add --no-cache git openssh bash && \
101+
ssh-keygen -A && \
102+
sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && \
103+
adduser git -D -G root -h /home/git -s /bin/bash && \
104+
passwd -d git && \
105+
su git -c "mkdir /home/git/.ssh && \
106+
ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \
107+
mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \
108+
mkdir /home/git/test.git && \
109+
git --bare init /home/git/test.git"
110+
111+
VOLUME ["/home/git/.ssh", "/home/git/test.git/hooks"]
112+
WORKDIR /home/git
113+
114+
CMD ["/usr/sbin/sshd", "-D"]
115+
```
116+
117+
3. Create a test pre-receive script called `always_reject.sh`. This example script will reject all pushes, which is useful for locking a repository:
118+
119+
```shell
120+
#!/usr/bin/env bash
121121

122122
echo "error: rejecting all pushes"
123123
exit 1

content/admin/user-management/migrating-to-internal-repositories.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ If you don't have private mode enabled, the migration script will have no effect
3333

3434
1. Connect to the administrative shell. For more information, see "[Accessing the administrative shell (SSH)](/enterprise/admin/installation/accessing-the-administrative-shell-ssh)."
3535
2. Navigate to the `/data/github/current` directory.
36-
```
36+
```shell
3737
cd /data/github/current
3838
```
3939
3. Run the migration command.
40-
```
40+
```shell
4141
sudo bin/safe-ruby lib/github/transitions/20191210220630_convert_public_ghes_repos_to_internal.rb --verbose -w | tee -a /tmp/convert_public_ghes_repos_to_internal.log
4242
```
4343

content/developers/apps/creating-a-github-app-from-a-manifest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Name | Type | Description
8080

8181
This example uses a form on a web page with a button that triggers the `POST` request for a user account:
8282

83-
```
83+
```html
8484
<form action="https://github.com/settings/apps/new?state=abc123" method="post">
8585
Create a GitHub App Manifest: <input type="text" name="manifest" id="manifest"><br>
8686
<input type="submit" value="Submit">
@@ -111,7 +111,7 @@ This example uses a form on a web page with a button that triggers the `POST` re
111111
```
112112
This example uses a form on a web page with a button that triggers the `POST` request for an organization account. Replace `ORGANIZATION` with the name of the organization account where you want to create the app.
113113

114-
```
114+
```html
115115
<form action="https://github.com/organizations/<em>ORGANIZATION</em>/settings/apps/new?state=abc123" method="post">
116116
Create a GitHub App Manifest: <input type="text" name="manifest" id="manifest"><br>
117117
<input type="submit" value="Submit">

content/developers/apps/creating-ci-tests-with-the-checks-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ To push to a repository, your app must have write permissions for "Repository co
724724

725725
In order to commit files, Git must know which [username](/articles/setting-your-username-in-git/) and [email](/articles/setting-your-commit-email-address-in-git/) to associate with the commit. Add two more environment variables in your `.env` file to store the name (`GITHUB_APP_USER_NAME`) and email (`GITHUB_APP_USER_EMAIL`) settings. Your name can be the name of your app and the email can be any email you'd like for this example. For example:
726726

727-
```
727+
```ini
728728
GITHUB_APP_USER_NAME=Octoapp
729729
GITHUB_APP_USER_EMAIL[email protected]
730730
```

content/developers/apps/identifying-and-authorizing-users-for-github-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Name | Type | Description
8989

9090
By default, the response takes the following form. The response parameters `expires_in`, `refresh_token`, and `refresh_token_expires_in` are only returned when you enable the beta for expiring user-to-server access tokens.
9191

92-
```
92+
```json
9393
{
9494
"access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a",
9595
"expires_in": "28800",

content/developers/overview/secret-scanning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Create a public, internet accessible HTTP endpoint at the URL you provided to us
6161

6262
##### Example POST sent to your endpoint
6363

64-
```
64+
```http
6565
POST / HTTP/1.1
6666
Host: HOST
6767
Accept: */*
@@ -95,7 +95,7 @@ Assuming you receive the following message, the code snippets below demonstrate
9595
The code also assumes you've set an environment variable called `GITHUB_PRODUCTION_TOKEN` with a generated PAT (https://github.com/settings/tokens). The token does not need any permissions set.
9696

9797
**Sample message sent to verify endpoint**
98-
```
98+
```http
9999
POST / HTTP/1.1
100100
Host: HOST
101101
Accept: */*

content/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can add YAML frontmatter to each issue template to pre-fill the issue title,
1818

1919
Here is example YAML front matter.
2020

21-
```
21+
```yaml
2222
---
2323
name: Tracking issue
2424
about: Use this template for tracking new features.

0 commit comments

Comments
 (0)