Update build.yml
This commit is contained in:
parent
34645f0122
commit
1b349bf617
1 changed files with 22 additions and 1 deletions
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
|
|
@ -264,6 +264,27 @@ jobs:
|
||||||
core.setOutput('exists', true);
|
core.setOutput('exists', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- name: 🔍 Check if milestone exists
|
||||||
|
id: check_milestone
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const version = '${{ steps.changelog.outputs.version }}';
|
||||||
|
try {
|
||||||
|
const milestones = await github.rest.issues.listMilestones({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'all'
|
||||||
|
});
|
||||||
|
const milestoneExists = milestones.data.some(milestone => milestone.title === version);
|
||||||
|
console.log(`Milestone "${version}" exists: ${milestoneExists}`);
|
||||||
|
return milestoneExists;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('Error checking milestones, assuming milestone does not exist');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
- name: 🔍 Create Pull Request if tag not found
|
- name: 🔍 Create Pull Request if tag not found
|
||||||
if: ${{ steps.check_existing_pr.outputs.exists == 'false' }}
|
if: ${{ steps.check_existing_pr.outputs.exists == 'false' }}
|
||||||
uses: devops-infra/action-pull-request@v1.0.2
|
uses: devops-infra/action-pull-request@v1.0.2
|
||||||
|
|
@ -271,7 +292,7 @@ jobs:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
source_branch: dev
|
source_branch: dev
|
||||||
target_branch: main
|
target_branch: main
|
||||||
milestone: ${{ steps.changelog.outputs.version || '' }}
|
milestone: ${{ steps.check_milestone.outputs.result == 'true' && steps.changelog.outputs.version || '' }}
|
||||||
ignore_users: "dependabot"
|
ignore_users: "dependabot"
|
||||||
draft: true
|
draft: true
|
||||||
title: 'Release: ${{ steps.changelog.outputs.version }}'
|
title: 'Release: ${{ steps.changelog.outputs.version }}'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue