Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions content/actions/creating-actions/creating-a-javascript-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ Before you begin, you'll need to download Node.js and create a public {% data va

1. From your terminal, change directories into your new repository.

```shell
```shell{:copy}
cd hello-world-javascript-action
```

1. From your terminal, initialize the directory with npm to generate a `package.json` file.

```shell
```shell{:copy}
npm init -y
```

## Creating an action metadata file

Create a new file named `action.yml` in the `hello-world-javascript-action` directory with the following example code. For more information, see "[Metadata syntax for {% data variables.product.prodname_actions %}](/actions/creating-actions/metadata-syntax-for-github-actions)."

```yaml
```yaml{:copy}
name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
Expand Down Expand Up @@ -92,7 +92,7 @@ The toolkit offers more than the `core` and `github` packages. For more informat

At your terminal, install the actions toolkit `core` and `github` packages.

```shell
```shell{:copy}
npm install @actions/core
npm install @actions/github
```
Expand All @@ -108,7 +108,7 @@ GitHub Actions provide context information about the webhook event, Git refs, wo
Add a new file called `index.js`, with the following code.

{% raw %}
```javascript
```javascript{:copy}
const core = require('@actions/core');
const github = require('@actions/github');

Expand Down Expand Up @@ -174,7 +174,7 @@ From your terminal, commit your `action.yml`, `index.js`, `node_modules`, `packa

It's best practice to also add a version tag for releases of your action. For more information on versioning your action, see "[About actions](/actions/automating-your-workflow-with-github-actions/about-actions#using-release-management-for-actions)."

```shell
```shell{:copy}
git add action.yml index.js node_modules/* package.json package-lock.json README.md
git commit -m "My first action is ready"
git tag -a -m "My first action release" v1.1
Expand Down Expand Up @@ -219,7 +219,7 @@ This example demonstrates how your new public action can be run from within an e
Copy the following YAML into a new file at `.github/workflows/main.yml`, and update the `uses: octocat/hello-world-javascript-action@v1.1` line with your username and the name of the public repository you created above. You can also replace the `who-to-greet` input with your name.

{% raw %}
```yaml
```yaml{:copy}
on: [push]

jobs:
Expand All @@ -246,7 +246,7 @@ Copy the workflow code into a `.github/workflows/main.yml` file in your action's

{% raw %}
**.github/workflows/main.yml**
```yaml
```yaml{:copy}
on: [push]

jobs:
Expand Down
20 changes: 10 additions & 10 deletions lib/rest/static/decorated/api.github.com.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions lib/rest/static/decorated/ghes-3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -36177,14 +36177,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -36213,14 +36213,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down Expand Up @@ -36718,14 +36718,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -36754,14 +36754,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down
16 changes: 8 additions & 8 deletions lib/rest/static/decorated/ghes-3.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -36299,14 +36299,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -36335,14 +36335,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down Expand Up @@ -36840,14 +36840,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -36876,14 +36876,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down
16 changes: 8 additions & 8 deletions lib/rest/static/decorated/ghes-3.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -37545,14 +37545,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -37581,14 +37581,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down Expand Up @@ -38086,14 +38086,14 @@
},
"contexts": {
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
},
Expand Down Expand Up @@ -38122,14 +38122,14 @@
},
{
"type": "array of strings",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch</p>",
"description": "<p><strong>Required</strong>. The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use <code>checks</code> instead of <code>contexts</code> for more fine-grained control.</p>",
"items": {
"type": "string"
},
"name": "contexts",
"in": "body",
"rawType": "array",
"rawDescription": "The list of status checks to require in order to merge into this branch",
"rawDescription": "The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
"childParamsGroups": []
}
]
Expand Down
Loading