Browse Source

Refactor workflow conditions to use event names instead of input flags (#330)

pull/331/head
Michał Chęciński 1 year ago committed by GitHub
parent
commit
5329383dfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      .github/workflows/build-unified.yml

12
.github/workflows/build-unified.yml

@ -10,18 +10,12 @@ on: @@ -10,18 +10,12 @@ on:
server_branch:
type: string
default: main
is_workflow_call:
type: boolean
default: true
workflow_dispatch:
inputs:
server_branch:
description: "Server branch name to deploy (examples: 'main', 'rc', 'feature/sm')"
type: string
default: main
is_workflow_call:
type: boolean
default: false
pull_request:
paths:
- ".github/workflows/build-unified.yml"
@ -39,14 +33,14 @@ jobs: @@ -39,14 +33,14 @@ jobs:
id-token: write
steps:
- name: Checkout Repository - workflow_call
if: ${{ inputs.is_workflow_call == true }}
if: ${{ github.event_name == 'workflow_call' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: bitwarden/self-host
ref: main
- name: Checkout Repository - workflow_dispatch
if: ${{ inputs.is_workflow_call != true }}
if: ${{ github.event_name != 'workflow_call' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get server branch to checkout
@ -66,7 +60,7 @@ jobs: @@ -66,7 +60,7 @@ jobs:
SERVER_BRANCH: ${{ steps.server-branch-name.outputs.server_branch }}
id: publish-branch-check
run: |
if [[ "${{ inputs.is_workflow_call }}" == "true" ]]; then
if [[ "${{ github.event_name }}" == "workflow_call" ]]; then
REF=main
else
REF=${GITHUB_REF#refs/heads/}

Loading…
Cancel
Save