You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/steps/2-step.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,10 @@ Nice! Now that we have the project initialized and dependencies installed, it's
7
7
The `@actions/core` library is the main library from the [GitHub Actions Toolkit](https://github.com/actions/toolkit), a collection of packages for building JavaScript GitHub Actions. It provides essential methods to interact with the GitHub Actions runtime environment, accept action inputs, and produce outputs for other workflow steps.
8
8
9
9
> [!TIP]
10
-
> The [GitHub Actions Toolkit](https://github.com/actions/toolkit) includes other useful libraries like `@actions/github` for interacting with the GitHub API and `@actions/artifact` for uploading and downloading artifacts.
11
-
>
10
+
> The [GitHub Actions Toolkit](https://github.com/actions/toolkit) includes other useful libraries like `@actions/github` for interacting with the GitHub API and `@actions/artifact` for uploading and downloading artifacts.
11
+
>
12
12
> Visit the [actions/toolkit](https://github.com/actions/toolkit) repository for more.
13
13
14
-
15
14
### ⌨️ Activity: Implement the Dad Jokes Action
16
15
17
16
Let's create the source files and implement the logic for your action.
@@ -21,7 +20,7 @@ Let's create the source files and implement the logic for your action.
21
20
1. Create `src/joke.js` file to hold the logic for fetching a joke from the `icanhazdadjoke.com` API:
22
21
23
22
```js
24
-
constrequest=require("request-promise");
23
+
importrequestfrom"request-promise";
25
24
26
25
constoptions= {
27
26
method:"GET",
@@ -38,7 +37,7 @@ Let's create the source files and implement the logic for your action.
38
37
returnres.joke;
39
38
}
40
39
41
-
module.exports= getJoke;
40
+
exportdefaultgetJoke;
42
41
```
43
42
44
43
The `getJoke` function makes an HTTP GET request to the `icanhazdadjoke.com` API and returns a random dad joke.
@@ -48,8 +47,8 @@ Let's create the source files and implement the logic for your action.
48
47
1. Create `src/main.js` that will be the main entry point for your action:
0 commit comments