mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 12:07:32 +00:00
* push to excess labels to avoid reaching the limit
* build dist
* never set more than 100 labels
* use splice instead of set
* ignore IDE folders
* install @octokit/plugin-retry
* always setLabels
* fix indentations
* fix specs
* add spec for excess labels
* prettier
* licensed cache
* revert to !!core.getInput('sync-labels')
* better warning for exceeded labels
* keep manually-added labels
* nest the dedupe logic
* rename `removeLabel` to `removeLabelFromList` to avoid confusion
* use Sets, and issue a call only if labels have actually changed
* remove IDE config folders from gitignore
* remove obsolete duplucation check
---------
Co-authored-by: Mark Massoud <mark@unrealcloud.io>
34 lines
544 B
TypeScript
34 lines
544 B
TypeScript
export const context = {
|
|
payload: {
|
|
pull_request: {
|
|
number: 123
|
|
}
|
|
},
|
|
repo: {
|
|
owner: 'monalisa',
|
|
repo: 'helloworld'
|
|
}
|
|
};
|
|
|
|
const mockApi = {
|
|
rest: {
|
|
issues: {
|
|
setLabels: jest.fn()
|
|
},
|
|
pulls: {
|
|
get: jest.fn().mockResolvedValue({}),
|
|
listFiles: {
|
|
endpoint: {
|
|
merge: jest.fn().mockReturnValue({})
|
|
}
|
|
}
|
|
},
|
|
repos: {
|
|
getContent: jest.fn()
|
|
}
|
|
},
|
|
paginate: jest.fn()
|
|
};
|
|
|
|
export const getOctokit = jest.fn().mockImplementation(() => mockApi);
|