Skip to content

Commit bb1f411

Browse files
committed
Add authorized user file
1 parent 6d4da7b commit bb1f411

File tree

10 files changed

+7564
-15
lines changed

10 files changed

+7564
-15
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ deliveries.
66

77
To get started, submit an issue using
88
[this template](https://github.com/githubschool/gh-github-intermediate-issueops/issues/new?template=create-class.yml)
9+
10+
In order to use this repository, you will need to be added to the authorized
11+
users file [here](./instructors.yml). If you are not added to this file, you
12+
will not be able to use the automation in this repository. To add yourself,
13+
submit a pull request to this file with your GitHub handle.

__fixtures__/github.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as octokit from './octokit.js'
33
export const getOctokit = () => octokit
44

55
export const context = {
6+
actor: 'test',
67
eventName: 'issues',
78
payload: {
89
action: 'opened',

__tests__/main.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { jest } from '@jest/globals'
2+
import { dedent } from 'ts-dedent'
23
import * as core from '../__fixtures__/core.js'
4+
import * as fs from '../__fixtures__/fs.js'
35
import * as github from '../__fixtures__/github.js'
46
import * as octokit from '../__fixtures__/octokit.js'
57
import { AllowedIssueAction, AllowedIssueCommentAction } from '../src/enums.js'
@@ -17,6 +19,7 @@ jest.unstable_mockModule('@octokit/rest', async () => {
1719
Octokit
1820
}
1921
})
22+
jest.unstable_mockModule('fs', () => fs)
2023

2124
const events_getAction: jest.SpiedFunction<
2225
typeof import('../src/events.js').getAction
@@ -74,6 +77,14 @@ const { Octokit } = await import('@octokit/rest')
7477
const mocktokit = jest.mocked(new Octokit())
7578

7679
describe('main', () => {
80+
beforeEach(() => {
81+
process.env.GITHUB_WORKSPACE = '.'
82+
83+
fs.readFileSync.mockReturnValue(dedent`instructors:
84+
85+
- test`)
86+
})
87+
7788
afterEach(() => {
7889
jest.resetAllMocks()
7990
})

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)