Skip to content

Commit

Permalink
DEV-405: Only release on main branch workflow_run
Browse files Browse the repository at this point in the history
  • Loading branch information
danschmidt5189 committed Nov 13, 2023
1 parent 32f3dc0 commit 0d50a15
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ on:
- published
workflow_dispatch:
workflow_run:
workflows:
- Build
types:
- completed
workflows: ["Build"]
types: ["completed"]
branches:
- main

env:
REGISTRY: ghcr.io

jobs:
setup:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
# See https://github.com/docker/build-push-action/blob/v2.10.0/TROUBLESHOOTING.md#repository-name-must-be-lowercase
- name: Sanitize image name
uses: actions/github-script@v6
id: image-name
Expand All @@ -36,9 +34,9 @@ jobs:
build_image: ${{ steps.image-name.outputs.result }}:${{ env.SHORT_SHA }}

push:
needs: setup
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
needs: setup
permissions:
packages: write
env:
Expand Down

0 comments on commit 0d50a15

Please sign in to comment.