Skip to content

Commit

Permalink
chore(actions): exclude drafts from PR notificiation (#53669)
Browse files Browse the repository at this point in the history
### What?

Do not count draft PRs

### Why?

These are still being worked on
  • Loading branch information
balazsorban44 committed Aug 9, 2023
1 parent 8e0d108 commit 6809edc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/pr-approved-open/index.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/actions/pr-approved-open/src/index.mjs
Expand Up @@ -13,15 +13,15 @@ async function run() {

const { owner, repo } = context.repo
const prs = await octoClient.rest.search.issuesAndPullRequests({
q: `repo:${owner}/${repo}+is:pr+is:open+review:approved`,
q: `repo:${owner}/${repo}+is:pr+is:open+review:approved -is:draft`,
})

const pendingPRs = prs.data.total_count

if (pendingPRs) {
await slackClient.chat.postMessage({
channel: '#coord-next-turbopack',
text: `🤖 Pending PRs for Next.js: There are <https://github.com/vercel/next.js/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved|${prs.data.items.length} PRs> awaiting merge.`,
text: `🤖 Pending PRs for Next.js: There are <https://github.com/vercel/next.js/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved+-is%3Adraft|${prs.data.items.length} PRs> awaiting merge.`,
username: 'GitHub Notifier',
icon_emoji: ':github:',
})
Expand Down

0 comments on commit 6809edc

Please sign in to comment.