Fail the job if docker tag matches MAJOR.MINOR.PATCH naming
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/**
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
@@ -39,6 +42,14 @@ jobs:
|
||||
run: |
|
||||
TAG=$(yq '... | select(has("uses") and .uses | test("docker://ghcr.io/getsentry/action-release-image:.*")) | .uses' action.yml | awk -F':' '{print $3}')
|
||||
echo "DOCKER_TAG=$TAG" >> $GITHUB_ENV
|
||||
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
if [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "Error: DOCKER_TAG ($TAG) is not allowed to match `MAJOR.MINOR.PATCH` inside a pull request."
|
||||
echo "Please rename the docker tag in `action.yml` and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
Reference in New Issue
Block a user