Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PR titles made by prepare/publish release workflows #5990

Open
wants to merge 15 commits into
base: V3/develop
Choose a base branch
from
Open
21 changes: 18 additions & 3 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automated Crowdin downstream
title: "[i18n] Automated Crowdin downstream"
title: "[${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}][i18n] Automated Crowdin downstream"
body: |
This is an automated PR that is part of Prepare Release automated workflow (2 out of 2).
Please ensure that there are no errors or invalid files are in the PR.
Expand Down Expand Up @@ -101,13 +101,28 @@ jobs:
);
return await script({github, context});

- name: Extract Semver
id: semver_parser
uses: actions/github-script@v6
with:
result-encoding: string
script: |
let semverString = "${{ steps.bump_version_stable.outputs.new_version }}";
if(semverString.startsWith("3.")){
semverString = semverString.split('.')[0][1];
return '[' + semverString + ']';
}
else{
return "";
}

- name: Create Pull Request
id: cpr_bump_stable
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Version bump to ${{ steps.bump_version_stable.outputs.new_version }}
title: Version bump to ${{ steps.bump_version_stable.outputs.new_version }}
commit-message: "${{ steps.semver_parser.outputs.result }} Version bump to ${{ steps.bump_version_stable.outputs.new_version }}"
title: "${{ steps.semver_parser.outputs.result }} Version bump to ${{ steps.bump_version_stable.outputs.new_version }}"
body: |
This is an automated PR that is part of Prepare Release automated workflow (1 out of 2).
Please ensure that there are no errors or invalid files are in the PR.
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,29 @@ jobs:
);
return await script({github, context});

- name: Extract Semver
id: semver_parser
#if: startsWith(steps.bump_version_stable.outputs.new_version, '3.')
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const semver = require('semver');
const semverString = "${{ steps.bump_version_stable.outputs.new_version }}";
if(semverString.startsWith("3.")){
return semver.coerce(semverString);
}
else{
return "";
}

- name: Create Pull Request
id: cpr_bump_dev
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Version bump to ${{ steps.bump_version_dev.outputs.new_version }}
title: Version bump to ${{ steps.bump_version_dev.outputs.new_version }}
commit-message: "[${{ steps.semver_parser.outputs.result }}.${{ steps.semver_parser.outputs.result }}]Version bump to ${{ steps.bump_version_dev.outputs.new_version }}"
title: "[${{ steps.semver_parser.outputs.result }}.${{ steps.semver_parser.outputs.result }}]Version bump to ${{ steps.bump_version_dev.outputs.new_version }}"
body: |
This is an automated PR.
Please ensure that there are no errors or invalid files are in the PR.
Expand Down