Skip to content

Commit bf91ade

Browse files
committed
edits
1 parent 5de6ad2 commit bf91ade

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

learn-pr/github/automate-github-using-github-script/includes/2-what-is-github-script.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ In this unit, you'll learn how GitHub Script enables you to automate common GitH
22

33
## What is GitHub Script?
44

5-
[GitHub Script](https://github.com/actions/github-script?azure-portal=true) is an action that provides an authenticated [Octokit](https://octokit.github.io/rest.js/?azure-portal=true) client and enables JavaScript to be written directly in a workflow file. It runs in [Node.js](https://nodejs.org/?azure-portal=true), so you have the power of that platform available when writing scripts.
5+
[GitHub Script](https://github.com/actions/github-script?azure-portal=true) is an action that provides an authenticated [Octokit](https://octokit.github.io/rest.js/?azure-portal=true) client and enables JavaScript to be written directly in a workflow file. It runs in [Node.js](https://nodejs.org/?azure-portal=true), so you have the power of that platform available when you write scripts.
66

77
## What is Octokit?
88

@@ -72,7 +72,7 @@ In this case, there's only one step: the GitHub Script action.
7272
})
7373
```
7474

75-
Using GitHub Actions can really help automate the events that take place in your repositories. Imagine that a repository visitor created a new issue containing information about a critical bug. You might want to thank them for bringing the bug to your attention, but this simple task can become overwhelming as your repository attracts more visitors. By automating an issue comment, you can automate the process of thanking visitors every time.
75+
Using GitHub Actions can really help automate the events that take place in your repositories. Imagine that a repository visitor opened a new issue containing information about a critical bug. You might want to thank them for bringing the bug to your attention, but this simple task can become overwhelming as your repository attracts more visitors. By automating an issue comment, you can automate the process of thanking visitors every time.
7676

7777
### Using actions/[email protected]
7878

@@ -82,7 +82,7 @@ This action requires a `github-token` that's provided at runtime so that request
8282

8383
The `script` parameter can be virtually any JavaScript that uses the octokit/rest/js client stored in `github`. In this case, it's just one line (split across multiple lines for readability) that creates a hardcoded comment.
8484

85-
After the workflow runs, GitHub Script logs the code it ran for review on the **Actions** tab.
85+
After the workflow runs, GitHub Script logs the code it ran for review on the **Actions** tab:
8686

8787
![Screenshot of a completed GitHub Script workflow.](../media/2-completed-workflow.png)
8888

learn-pr/github/automate-github-using-github-script/includes/3-use-github-script.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ One advantage of breaking the current workflow into multiple steps is that it en
4040

4141
To separate the example workflow into steps:
4242

43-
- Name each step so that you can track it from the Actions tab.
43+
- Name each step so that you can track it from the **Actions** tab.
4444
- Use expressions to determine whether a step should run (optional).
4545

4646
In this example, the two tasks in the original workflow file are separated into individual steps:
@@ -78,15 +78,15 @@ jobs:
7878
});
7979
```
8080

81-
Each step includes a descriptive `name` element that also helps you track it from the Actions tab.
81+
Each step includes a descriptive `name` element that also helps you track it from the **Actions** tab.
8282

8383
The `Add issue to project board` step also includes an `if` statement that specifies that the issue should be added to the project board only if it's labeled `bug`.
8484

8585
## Use the Node.js environment
8686

8787
GitHub Script also grants you access to a full Node.js environment. Although we don't recommend using GitHub Script to write the logic for complex actions, you can use it to add more functionality to the octo/rest.js API.
8888

89-
For example, you could use the Node.js to display a contribution guide whenever an issue is opened. You can use the Node.js file system to read a file and use it as the body of the issue comment. To access files within the repository, include the `actions/checkout` action as the first step in the workflow.
89+
For example, you could use Node.js to display a contribution guide whenever an issue is opened. You can use the Node.js file system to read a file and use it as the body of the issue comment. To access files within the repository, include the `actions/checkout` action as the first step in the workflow.
9090

9191
The following example makes the following changes to the workflow file:
9292

0 commit comments

Comments
 (0)