Update build.yml
This commit is contained in:
parent
ba772b26d9
commit
3b16e8abc2
1 changed files with 24 additions and 11 deletions
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
|
|
@ -219,19 +219,30 @@ jobs:
|
|||
- name: 🔍 Check existing PRs
|
||||
id: check_existing_pr
|
||||
uses: actions/github-script@v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const { data: prs } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: 'dev',
|
||||
base: 'main'
|
||||
});
|
||||
|
||||
return prs.length > 0;
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
script: |
|
||||
try {
|
||||
const { data: prs } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:dev`,
|
||||
base: 'main'
|
||||
});
|
||||
|
||||
if (prs.length > 0) {
|
||||
console.log(`ℹ️ Found existing PR from dev to main: ${prs[0].html_url}`);
|
||||
core.setOutput('exists', 'true');
|
||||
} else {
|
||||
core.setOutput('exists', 'false');
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(`❌ Failed to check existing PRs: ${error}`);
|
||||
core.setOutput('exists', 'error');
|
||||
}
|
||||
|
||||
|
||||
- name: 📄 Create Pull Request if tag not found
|
||||
if: ${{ !steps.check_existing_pr.outputs.result }}
|
||||
|
|
@ -240,6 +251,8 @@ jobs:
|
|||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
source_branch: dev
|
||||
target_branch: main
|
||||
reviewer: Xikaro
|
||||
ignore_users: "dependabot"
|
||||
title: 'Release: ${{ needs.info.outputs.project_version }}'
|
||||
body: |
|
||||
**This is an automated Pull Request from the dev branch.**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue