Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Update 14_create-js-files.md #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 13 additions & 3 deletions responses/14_create-js-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The first two lines will import packages from the [Actions ToolKit](https://gith
```javascript
const core = require("@actions/core");
const github = require("@actions/github");
const { Octokit} = require('@octokit/rest')
```

**Creating the main function**
Expand Down Expand Up @@ -89,7 +90,10 @@ async function run() {
const jokeBody = core.getInput("joke");
const token = core.getInput("repo-token");

const octokit = github.getOctokit(token);
const octokit = new Octokit({
auth: token,
userAgent: 'action-three',
});
} catch (err) {}
}

Expand All @@ -106,7 +110,10 @@ async function run() {
const jokeBody = core.getInput("joke");
const token = core.getInput("repo-token");

const octokit = github.getOctokit(token);
const octokit = new Octokit({
auth: token,
userAgent: 'action-three',
});

const newIssue = await octokit.issues.create({
repo: github.context.repo.repo,
Expand All @@ -132,7 +139,10 @@ async function run() {
const jokeBody = core.getInput("joke");
const token = core.getInput("repo-token");

const octokit = github.getOctokit(token);
const octokit = new Octokit({
auth: token,
userAgent: 'action-three',
});

const newIssue = await octokit.issues.create({
repo: github.context.repo.repo,
Expand Down