Skip to content

Commit

Permalink
Use context api instead of environment variables (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkarlsen authored May 15, 2022
1 parent 6ff3368 commit b66afde
Show file tree
Hide file tree
Showing 4 changed files with 8,327 additions and 1,548 deletions.
4 changes: 3 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {run} from '../src/main'
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as github from '@actions/github'
import {beforeEach} from 'jest-circus'
import {Context} from '@actions/github/lib/context'

let inputs = {} as any

Expand All @@ -27,6 +29,6 @@ beforeEach(() => {

test('test runs', async () => {
process.env['GITHUB_REPOSITORY'] = 'someOrg/someRepo'
process.env['GITHUB_RUN_NUMBER'] = '11'
github.context.runNumber = 11
await expect(run()).resolves.not.toThrow
})
Loading

0 comments on commit b66afde

Please sign in to comment.