Skip to content

get version

get version #2

Workflow file for this run

name: Devops Test
on:
push:
branches: [ devops-test-pipeline-0.2.0 ]
workflow_dispatch:
jobs:
get-version:
name: Retrieve version
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.get-version.outputs.VERSION }}
steps:
- id: get-version
run: |
default-release=${{ github.event.repository.default_branch }}
version=$(echo "$default-release" | sed -E 's/release-(.*)/\1/')
echo "VERSION=$version" >> $GITHUB_OUTPUT
devops-test:
name: Devops test
runs-on: ubuntu-latest
needs: [get-version]
env:
VERSION: ${{ needs.get-version.outputs.output1 }}
steps:
- name: print version
run: |
echo "The default branch is ${{ env.VERSION }}"