1
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2025-03-28 11:00:05 +01:00

Warn on attempts to publish test-ubuntu-git from non-main branch.

This commit is contained in:
John Wesley Walker III 2024-02-22 13:55:07 +01:00 committed by GitHub
parent 2650dbd060
commit fc4e79024e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,6 +42,10 @@ jobs:
# Use `date` with a custom format to achieve the key=value format GITHUB_OUTPUT expects.
run: date -u "+now=%Y%m%d.%H%M%S.%3NZ" >> "$GITHUB_OUTPUT"
- name: Issue Image Publish Warning
if: ${{ inputs.publish && github.ref_name != 'main' }}
run: echo "::warning::test-ubuntu-git images can only be published from the actions/checkout 'main' branch. Workflow will continue with push/publish disabled."
# Use `docker/build-push-action` to build (and optionally publish) the image.
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0