Skip to content

ci: (DSO-00) Fix tag regex to allow double digits #11

ci: (DSO-00) Fix tag regex to allow double digits

ci: (DSO-00) Fix tag regex to allow double digits #11

Workflow file for this run

name: 🧪 Tests
on:
push:
paths-ignore:
- 'CODE_OF_CONDUCT`'
- 'LICENSE'
- 'README.md'
branches:
- main
tags:
- v[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}
- v[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}-uat.[0-9]
pull_request:
paths-ignore:
- 'CODE_OF_CONDUCT`'
- 'LICENSE'
- 'README.md'
branches:
- main
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current code ref
uses: actions/checkout@v4
- name: 📝 Set ENVIRONMENT
id: env
uses: ./
- name: Check ENVIRONMENT matches expected value
run: |
if [[ "$GITHUB_REF_NAME" =~ ^v([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})$ ]]; then
if [[ ${{ steps.env.outputs.environment }} != 'production' ]]; then
exit 1;
fi
elif [[ "$GITHUB_REF_NAME" =~ ^v([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})(-uat.[0-9]{1,2})$ ]]; then
if [[ ${{ steps.env.outputs.environment }} != 'uat' ]]; then
exit 1;
fi
else
if [[ ${{ steps.env.outputs.environment }} != 'stage' ]]; then
exit 1;
fi
fi