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

@@ -10,13 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release for ${{ github.event.client_payload.ReleaseBranchName }}
uses: ncipollo/release-action@v1.16.0
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 #v1.16.0
with:
tag: ${{ github.event.client_payload.ReleaseBranchName }}
name: ${{ github.event.client_payload.ReleaseTitle }}
body: ${{ github.event.client_payload.ReleaseBody }}
prerelease: ${{ github.event.client_payload.Prerelease }}
commit: ${{ github.event.client_payload.Commitish }}
allowUpdates: true

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

View File

@@ -10,8 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update release for ${{ github.event.client_payload.ReleaseBranchName }}
uses: actions/github-script@v7
with: