Skip to content
Merged
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
27 changes: 12 additions & 15 deletions .github/workflows/pr-graphql-operations-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Install dependencies
run: yarn install

- name: Fetch latest PR description
id: pr-body
- name: Extract GraphQL endpoints from PR description
id: endpoints
uses: actions/github-script@v7
with:
script: |
Expand All @@ -36,19 +36,16 @@ jobs:
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
core.setOutput('body', pr.data.body || '');
- name: Extract GraphQL endpoints from PR description
id: endpoints
run: |
BODY="${{ steps.pr-body.outputs.body }}"
ENDPOINTS=$(echo "$BODY" | grep -iEo 'GraphQL Endpoint:\s*(https?://[^ ]+/graphql)' | sed -E 's/GraphQL Endpoint:\s*//' | paste -sd, -)
if [ -n "$ENDPOINTS" ]; then
echo "Found endpoints in PR: $ENDPOINTS"
echo "endpoints=$ENDPOINTS" >> "$GITHUB_OUTPUT"
else
echo "No endpoints found in PR – will use default or env."
echo "endpoints=" >> "$GITHUB_OUTPUT"
fi
const body = pr.data.body || '';
const matches = [...body.matchAll(/GraphQL Endpoint:\s*(https?:\/\/[^ ]+\/graphql)/gi)];
const endpoints = matches.map(m => m[1]).join(',');
if (endpoints) {
core.info(`Found endpoints in PR: ${endpoints}`);
core.setOutput('endpoints', endpoints);
} else {
core.info('No endpoints found in PR – will use default or env.');
core.setOutput('endpoints', '');
}
- name: Determine final endpoints list
id: final-endpoints
run: |
Expand Down