Skip to content

Commit

Permalink
Chore: create a release only if PR is merged (#3028)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Dec 18, 2023
1 parent 2fc99ae commit 9435a4a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ on:

jobs:
tag-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
if: github.event.pull_request.merged == true
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Extract version
if: github.event.pull_request.merged == true
id: version
run: |
NEW_VERSION=$(node -p 'require("./package.json").version')
echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Create a git tag
if: github.event.pull_request.merged == true
if: steps.version.outputs.version
run: git tag ${{ steps.version.outputs.version }} && git push --tags

- name: GitHub release
if: success()
if: steps.version.outputs.version
uses: softprops/action-gh-release@v1
id: create_release
with:
Expand Down

0 comments on commit 9435a4a

Please sign in to comment.