We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25e2874 commit 6a880e1Copy full SHA for 6a880e1
.github/actions/joke-action/joke.js
@@ -0,0 +1,18 @@
1
+const request = require("request-promise");
2
+
3
+const options = {
4
+ method: "GET",
5
+ uri: "https://icanhazdadjoke.com/",
6
+ headers: {
7
+ Accept: "application/json",
8
+ "User-Agent": "Writing JavaScript action GitHub Skills course.",
9
+ },
10
+ json: true,
11
+};
12
13
+async function getJoke() {
14
+ const res = await request(options);
15
+ return res.joke;
16
+}
17
18
+module.exports = getJoke;
.github/actions/joke-action/main.js
@@ -0,0 +1,10 @@
+const getJoke = require("./joke");
+const core = require("@actions/core");
+async function run() {
+ const joke = await getJoke();
+ console.log(joke);
+ core.setOutput("joke-output", joke);
+run();
0 commit comments