Skip to content

Update UploadReleaseGithub.yml #17

Update UploadReleaseGithub.yml

Update UploadReleaseGithub.yml #17

name: Upload release github
on:
push:
tags:
- release.**
jobs:
job1:
runs-on: ubuntu-latest
outputs:
branchname: ${{ steps.step1.outputs.branchname }}
steps:
- id: step1
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw/origin\/}
echo "branchname=$branch" >> $GITHUB_OUTPUT
build:
environment: build
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
BRANCH_NAME: ${{ needs.branch.outputs.branchname }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Only release from main branch
- name: Upload if on main branch
if: endsWith(branch, 'test') == true

Check failure on line 30 in .github/workflows/UploadReleaseGithub.yml

View workflow run for this annotation

GitHub Actions / Upload release github

Invalid workflow file

The workflow is not valid. .github/workflows/UploadReleaseGithub.yml (Line: 30, Col: 13): Unrecognized named-value: 'branch'. Located at position 10 within expression: endsWith(branch, 'test') == true
run: ./gradlew publish
# Only release from main branch
- name: Write if not in main branch
if: endsWith(${{ env.BRANCH_NAME }}, 'test') == false
run: |
echo NOT ON MAIN BRANCH
echo ${{ env.BRANCH_NAME }}