Skip to content

Commit

Permalink
Merge pull request #1 from JasonEtco/actions-toolkit-100
Browse files Browse the repository at this point in the history
Update actions-toolkit
  • Loading branch information
JasonEtco committed Jan 28, 2019
2 parents d799688 + 3cfc258 commit 8a69e9a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 91 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ LABEL "repository"="http://github.com/JasonEtco/create-an-issue"
LABEL "homepage"="http://github.com/JasonEtco/create-an-issue"
LABEL "maintainer"="Jason Etcovitch <jasonetco@github.com>"

ADD package.json /package.json
ADD package-lock.json /package-lock.json
WORKDIR /

COPY package*.json ./
RUN npm ci
COPY . .

COPY . /

ENTRYPOINT ["node", "/entrypoint.js"]
ENTRYPOINT ["node", "/entrypoint.js"]
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ class IssueCreator {
}

console.log('Templates compiled', templated)

console.log('Creating new issue')
// Get an authenticated Octokit client
const octokit = this.tools.createOctokit()

// Create the new issue
return octokit.issues.create(this.tools.context.repo({
return this.tools.github.issues.create(this.tools.context.repo({
...templated,
assignees: attributes.assignees || [],
labels: attributes.labels || [],
Expand Down
159 changes: 82 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Jason Etcovitch <jasonetco@gmail.com>",
"license": "MIT",
"dependencies": {
"actions-toolkit": "0.0.4",
"actions-toolkit": "^1.1.0",
"front-matter": "^3.0.1",
"js-yaml": "^3.12.0",
"nunjucks": "^3.1.4",
Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('create-an-issue', () => {

issueCreator.tools.workspace = path.join(__dirname, 'fixtures')
issueCreator.tools.context.payload = { repository: { owner: { login: 'JasonEtco' }, name: 'waddup' } }
issueCreator.tools.createOctokit = jest.fn(() => github)
issueCreator.tools.github = github
})

it('creates a new issue', async () => {
Expand All @@ -23,7 +23,7 @@ describe('create-an-issue', () => {
issueCreator = new IssueCreator('.github/different-template.md')
issueCreator.tools.workspace = path.join(__dirname, 'fixtures')
issueCreator.tools.context.payload = { repository: { owner: { login: 'JasonEtco' }, name: 'waddup' } }
issueCreator.tools.createOctokit = jest.fn(() => github)
issueCreator.tools.github = github

await issueCreator.go()
expect(github.issues.create).toHaveBeenCalled()
Expand Down

0 comments on commit 8a69e9a

Please sign in to comment.