Skip to content

Commit

Permalink
get version
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanfandevops committed Jul 25, 2024
1 parent 40487f9 commit f319f57
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/devops-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@ on:

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 default branch name
- name: print version
run: |
echo "The default branch is ${{ github.event.repository.default_branch }}"
echo "The default branch is ${{ env.VERSION }}"

0 comments on commit f319f57

Please sign in to comment.