feat: remove unnecessary bool return from new functions (#110) #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PASSAGE_APP_ID: ${{ secrets.PASSAGE_APP_ID }} | |
PASSAGE_API_KEY: ${{ secrets.PASSAGE_API_KEY }} | |
PASSAGE_USER_ID: ${{ secrets.PASSAGE_USER_ID }} | |
PASSAGE_AUTH_TOKEN: ${{ secrets.PASSAGE_AUTH_TOKEN }} | |
jobs: | |
run-test-workflow: | |
uses: ./.github/workflows/on-pull-request.yml | |
secrets: inherit | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: run-test-workflow | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Read version | |
run: | | |
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV | |
- name: Check if release is needed | |
id: check | |
run: | | |
_last_version=`git describe --tags --abbrev=0` | |
if [[ "$VERSION" == "$_last_version" ]]; then | |
# no release needed | |
echo ::set-output name=create_release::false | |
else | |
echo ::set-output name=create_release::true | |
fi | |
- name: Create Release | |
if: ${{ steps.check.outputs.create_release == 'true' }} | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: Release ${{ env.VERSION }} | |
draft: false | |
prerelease: false |