mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 11:07:02 +00:00
Update Release and Pull Request creation workflows (#12767)
This commit is contained in:
committed by
GitHub
parent
8384138a4a
commit
b8f3c687ea
5
.github/workflows/create_github_release.yml
vendored
5
.github/workflows/create_github_release.yml
vendored
@@ -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
|
||||
|
||||
24
.github/workflows/create_pull_request.yml
vendored
24
.github/workflows/create_pull_request.yml
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/update_github_release.yml
vendored
2
.github/workflows/update_github_release.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user