-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { IssuePullPayload, PayloadIsIssue } from '../types' | ||
|
||
import { GitHubBot } from '../github.bot' | ||
import { extractOwnerRepo } from '../utils/extractOwnerRepo' | ||
import { senderIsBot } from '../utils/filter' | ||
|
||
const label = 'New default repository' | ||
const postedComment = ` | ||
Your repository is now waiting to be included in HACS. Please be patient, this will take some time. | ||
[You can see the current queue here](https://github.com/hacs/default/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse+sort%3Acreated-asc) (this is the order that is being used). | ||
There is no need to: | ||
- Comment on the PR, the reviewer will get back to you. | ||
- Open a new PR, this will not speed up the process. | ||
- Ask your folowers to spam the PR, this will not speed up the process. | ||
` | ||
|
||
export default async ( | ||
bot: GitHubBot, | ||
payload: IssuePullPayload, | ||
): Promise<void> => { | ||
if ( | ||
senderIsBot(payload) || | ||
!PayloadIsIssue(payload) || | ||
payload.repository.name !== 'default' || | ||
payload.action !== 'labeled' || | ||
payload.label?.name !== label | ||
) { | ||
return | ||
} | ||
|
||
await bot.github.octokit.rest.issues.createComment({ | ||
...extractOwnerRepo(payload), | ||
issue_number: payload.issue.number, | ||
body: postedComment, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters