Skip to content

Commit

Permalink
chore(fix): workflow version
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Feb 23, 2024
1 parent 539ae8a commit 24b6717
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/semantic_version.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
name: Determine Next Release Version
name: Final

on:
pull_request:
branches:
- main

jobs:
dry-release:
build:
runs-on: ubuntu-latest
outputs:
new-release-version: ${{ steps.dry-release.outputs.new-release-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: Install dependencies
run: npm install

- name: Checkout code
uses: actions/checkout@v3
with:
Expand All @@ -33,17 +24,16 @@ jobs:
OUTPUT="$(bash -c "unset GITHUB_ACTIONS && npx semantic-release --dry-run --no-ci --branches '${HEAD_REF}'")"
NEW_RELEASE_VERSION=$(echo "$OUTPUT" | grep -oP 'The next release version is \K(\d+\.\d+\.\d+)')
echo "new-release-version=$NEW_RELEASE_VERSION" >> "$GITHUB_OUTPUT"
comment:
runs-on: ubuntu-latest
needs: dry-release
steps:
- uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
- name: Use the version
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Suggested release version: ${{needs.dry-release.outputs.new-release-version}}'
body: 'Suggested release version: ${{ steps.dry-release.outputs.new-release-version}}'
})

0 comments on commit 24b6717

Please sign in to comment.