Skip to content

Bonding contract support #20

Bonding contract support

Bonding contract support #20

name: Final
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
outputs:
new-release-version: ${{ steps.dry-release.outputs.new-release-version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Set up Node.js
uses: actions/setup-node@v3
- name: Semantic Release dry run
id: dry-release
run: |
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"
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: ${{ steps.dry-release.outputs.new-release-version}}'
})