mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Fixed several issues with create-release-branch job
- uses the `semver` bash tool so we don't have to deal with NPM dependencies - also cleans up the env variables
This commit is contained in:
parent
4e85343a94
commit
82c3e6b6a4
24
.github/workflows/create-release-branch.yml
vendored
24
.github/workflows/create-release-branch.yml
vendored
@ -25,22 +25,22 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- run: npm install -g semver
|
||||
- run: |
|
||||
echo "current_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
echo "current_version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||
- uses: asdf-vm/actions/install@v1
|
||||
with:
|
||||
tool_versions: |
|
||||
semver 3.3.0
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
env:
|
||||
CURRENT_SHA: '${{ env.current_sha }}'
|
||||
CURRENT_VERSION: '${{ env.current_version }}'
|
||||
BUMP_TYPE: '${{ inputs.bump-type }}'
|
||||
- run: |
|
||||
echo "CURRENT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
echo "NEW_VERSION=$(semver bump ${{ inputs.bump-type }} $(git describe --tags --abbrev=0))" >> $GITHUB_ENV
|
||||
|
||||
- name: Create branch
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const semver = require('semver');
|
||||
const branchName = `v${semver.inc(process.env.CURRENT_VERSION, process.env.BUMP_TYPE)}`;
|
||||
const branchName = `v${process.env.NEW_VERSION}`;
|
||||
console.log(`Creating branch: ${branchName}`);
|
||||
await octokit.request('POST /repos/{owner}/{repo}/git/refs', {
|
||||
await github.request('POST /repos/{owner}/{repo}/git/refs', {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: `refs/heads/${branchName}`,
|
||||
|
Loading…
Reference in New Issue
Block a user