Skip to content

Commit

Permalink
Replace Semver-Parser for github_script
Browse files Browse the repository at this point in the history
  • Loading branch information
BigPeep0doo committed Feb 22, 2023
1 parent 6f22bb5 commit c2a0c72
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,26 @@ jobs:
- name: Extract Semver
id: semver_parser
uses: booxmedialtd/[email protected]
uses: actions/github-script@v6
with:
input_string: ${{ steps.bump_version_stable.outputs.new_version }}
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_stable
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "[${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}] Version bump to ${{ steps.bump_version_stable.outputs.new_version }}"
title: "[${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}] Version bump to ${{ steps.bump_version_stable.outputs.new_version }}"
commit-message: "[${{ steps.semver_parser.outputs.result }}.${{ steps.semver_parser.outputs.result }}] Version bump to ${{ steps.bump_version_stable.outputs.new_version }}"
title: "[${{ steps.semver_parser.outputs.result }}.${{ 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
18 changes: 14 additions & 4 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,27 @@ jobs:
- name: Extract Semver
id: semver_parser
uses: booxmedialtd/[email protected]
#if: startsWith(steps.bump_version_stable.outputs.new_version, '3.')
uses: actions/github-script@v6
with:
input_string: ${{ steps.bump_version_stable.outputs.new_version }}
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: "[${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}]Version bump to ${{ steps.bump_version_dev.outputs.new_version }}"
title: "[${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}]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

0 comments on commit c2a0c72

Please sign in to comment.