Skip to content

Commit

Permalink
Run release drafter only on PR merge to master
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Oct 25, 2024
1 parent df6247d commit 23c5803
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release Drafter and Publisher

on:
pull_request:
branches:
- master
types:
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
Expand All @@ -14,7 +14,7 @@ permissions:

jobs:
new_release:
# if: github.event.pull_request.merged == true
if: github.ref == 'refs/heads/master' && github.event.pull_request.merged == true
permissions:
# write permission is required to create a github release
contents: write
Expand Down Expand Up @@ -75,18 +75,18 @@ jobs:
git commit -m "Update CHANGELOG.md for PR #${{ github.event.pull_request.number }}"
- name: Push changes
run: git push origin HEAD:patch/add-changelog
run: git push origin HEAD:master

# - name: Create and publish new tag
# run: |
# git tag ${{ steps.nextversion.outputs.NEXT_VERSION }}
# git push origin ${{ steps.nextversion.outputs.NEXT_VERSION }}
- name: Create and publish new tag
run: |
git tag ${{ steps.nextversion.outputs.NEXT_VERSION }}
git push origin ${{ steps.nextversion.outputs.NEXT_VERSION }}
# - uses: release-drafter/release-drafter@v5
# with:
# commitish: master
# name: "stellar-etl ${{ steps.nextversion.outputs.NEXT_VERSION }}"
# tag: ${{ steps.nextversion.outputs.NEXT_VERSION }}
# publish: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: release-drafter/release-drafter@v5
with:
commitish: master
name: "stellar-etl ${{ steps.nextversion.outputs.NEXT_VERSION }}"
tag: ${{ steps.nextversion.outputs.NEXT_VERSION }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 23c5803

Please sign in to comment.