Skip to content
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
7 changes: 4 additions & 3 deletions .github/workflows/schema-change-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ jobs:
with:
script: |-
const { repo, owner } = context.repo;
const pulls = await github.rest.pulls.list({
// The `head` filter of pulls.list only matches an exact branch name, so list all open PRs and filter by prefix.
const pulls = await github.paginate(github.rest.pulls.list, {
owner,
repo,
state: 'open',
head: `${owner}:chore/schema-update-`
per_page: 100,
});
const schemaUpdatePRs = pulls.data.filter(pr => pr.head.ref.startsWith('chore/schema-update-'));
const schemaUpdatePRs = pulls.filter(pr => pr.head.ref.startsWith('chore/schema-update-'));
if (schemaUpdatePRs.length > 0) {
console.log(`Found existing schema update PR: ${schemaUpdatePRs[0].html_url}`);
core.setOutput('exists', 'true');
Expand Down
7 changes: 4 additions & 3 deletions workflows/schema-change-check.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ const checkExistingPR = new Step({
with: {
script: dedentString(`
const { repo, owner } = context.repo;
const pulls = await github.rest.pulls.list({
// The \`head\` filter of pulls.list only matches an exact branch name, so list all open PRs and filter by prefix.
const pulls = await github.paginate(github.rest.pulls.list, {
owner,
repo,
state: 'open',
head: \`\${owner}:chore/schema-update-\`
per_page: 100,
});
const schemaUpdatePRs = pulls.data.filter(pr => pr.head.ref.startsWith('chore/schema-update-'));
const schemaUpdatePRs = pulls.filter(pr => pr.head.ref.startsWith('chore/schema-update-'));
if (schemaUpdatePRs.length > 0) {
console.log(\`Found existing schema update PR: \${schemaUpdatePRs[0].html_url}\`);
core.setOutput('exists', 'true');
Expand Down
Loading