Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(actions): exclude drafts from PR notificiation #53669

Merged
merged 5 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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.`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future PR, you might want to define the query in a variable above so you can use it here with encodeURIComponent(q)

username: 'GitHub Notifier',
icon_emoji: ':github:',
})
Expand Down
Loading