Only create tags (not releases) when merging PRs into master (#7462)
* Create a tag instead of a release * Rename script to 'tags' (not 'release')
This commit is contained in:
parent
8778a305f4
commit
996fb5c21b
1 changed files with 13 additions and 14 deletions
|
|
@ -8,8 +8,8 @@ on:
|
|||
- release/**
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
if: ${{ vars.CREATE_RELEASE }}
|
||||
create-tag:
|
||||
if: ${{ vars.CREATE_TAGS }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
|
@ -35,16 +35,15 @@ jobs:
|
|||
current-version: ${{ env.CURRENT_VERSION }}
|
||||
override-stage: ${{ env.OVERRIDE_STAGE }}
|
||||
|
||||
- name: Print next version
|
||||
run: echo ${{ steps.next-version.outputs.next-version }}
|
||||
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
|
||||
- name: Create git tag
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
tag_name: ${{ steps.next-version.outputs.next-version }}
|
||||
release_name: ${{ steps.next-version.outputs.next-version }}
|
||||
draft: false
|
||||
prerelease: ${{ !startsWith(github.ref, 'refs/heads/release') }}
|
||||
script: |
|
||||
const ref = `refs/tags/${{ steps.next-version.outputs.next-version }}`;
|
||||
const sha = context.sha;
|
||||
await github.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: ref,
|
||||
sha: sha,
|
||||
});
|
||||
Loading…
Reference in a new issue