Update main_cicd_test.yml #16
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: Main Server CI/CD | ||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [ "close" ] | ||
permissions: | ||
contents: read | ||
jobs: | ||
check-branch: | ||
if: contains(github.head_ref, 'Release') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check branch | ||
run: | | ||
echo 'Passed the check to see if it was a release branch' | ||
check-merged: | ||
needs: check-branch | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check merged | ||
run: | | ||
echo 'The PR was merged' | ||
extract-version: | ||
needs: check-merged | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GITHUB_SHA }} | ||
- name: extract version | ||
run: | | ||
echo $(echo "$(git show -s --format=%s)" | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') >> "$GITHUB_ENV" | ||
use-env-test: | ||
needs: extract-version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: use env test | ||
run: | | ||
echo "$VERSION" |