Skip to content

Commit a6b165b

Browse files
authored
ci: add few validations (#12)
* ci: add permissions to write Signed-off-by: Sai Ranjit Tummalapalli <[email protected]> * ci: add few conditions Signed-off-by: Sai Ranjit Tummalapalli <[email protected]> --------- Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
1 parent 827fdfb commit a6b165b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
release-stable:
1919
runs-on: ubuntu-latest
2020
name: Release Stable
21-
outputs:
22-
published: ${{ steps.changesets.outputs.published }}
21+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
2322
steps:
2423
- name: Checkout Repo
2524
uses: actions/checkout@v4
@@ -50,7 +49,7 @@ jobs:
5049
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
5150

5251
- name: Create Github Release
53-
if: steps.changesets.outputs.published == 'true'
52+
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
5453
uses: softprops/action-gh-release@v2
5554
with:
5655
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}
@@ -59,7 +58,8 @@ jobs:
5958
runs-on: ubuntu-latest
6059
name: Release Unstable
6160
needs: release-stable
62-
if: always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
61+
if: "always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'ayanworks/credo-ethr-module') || (github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version'))"
62+
6363
steps:
6464
- name: Checkout Repo
6565
uses: actions/checkout@v4

0 commit comments

Comments
 (0)