Update Release and Pull Request creation workflows (#12767)

This commit is contained in:
Shamil Mubarakshin
2025-08-18 12:12:17 +02:00
committed by GitHub
parent 8384138a4a
commit b8f3c687ea
3 changed files with 21 additions and 10 deletions

View File

@@ -26,15 +26,29 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
let response = await github.rest.pulls.create({
const pulls = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
title: "${{ github.event.client_payload.PullRequestTitle }}",
head: "${{ github.event.client_payload.ReleaseBranchName }}-docs",
head: `${context.repo.owner}:${{ github.event.client_payload.ReleaseBranchName }}-docs`,
base: "${{ github.event.client_payload.PullRequestBase }}",
body: `${{ github.event.client_payload.PullRequestBody }}`
state: 'open'
});
return response.data.number
if (pulls.data.length > 0) {
console.log(`Pull request already exists: ${pulls.data[0].html_url}`);
return pulls.data[0].number;
} else {
console.log('No existing pull request found, creating new one');
let response = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "${{ github.event.client_payload.PullRequestTitle }}",
head: "${{ github.event.client_payload.ReleaseBranchName }}-docs",
base: "${{ github.event.client_payload.PullRequestBase }}",
body: `${{ github.event.client_payload.PullRequestBody }}`
});
return response.data.number;
}
- name: Request reviewers
uses: actions/github-script@v7