1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-04 14:13:28 +01:00

Move to more robust logic

This commit is contained in:
Micaiah Martin 2024-10-22 09:20:05 -06:00
parent f71f7458d3
commit 2678e26cd0

View File

@ -8,24 +8,27 @@ jobs:
validate-pr: validate-pr:
name: Validate PR name: Validate PR
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
outputs:
config-exists: ${{ steps.validate-config.outputs.config-exists }}
steps: steps:
- name: Checkout PR - name: Checkout PR
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Validate config existed on branch - name: Validate config existed on branch
id: validate-config
run: | run: |
# Search the git history for config files, exit if not found. # Search the git history for config files, exit if not found.
if [[ -z $(git rev-list --all -- "ephemeral-environments/$GITHUB_HEAD_REF.yaml") ]]; then if [[ -n $(git rev-list --all -- "ephemeral-environments/$GITHUB_HEAD_REF.yaml") ]]; then
echo "No ephemeral environment config found on branch, exiting." echo "Ephemeral environment config found on branch, continuing."
exit 1 echo "config-exists=true" >> $GITHUB_OUTPUT
fi fi
echo "Ephemeral environment config found on branch, continuing."
cleanup-config: cleanup-config:
name: Cleanup ephemeral environment name: Cleanup ephemeral environment
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
needs: validate-pr needs: validate-pr
if: ${{ needs.validate-pr.outputs.config-exists }}
steps: steps:
- name: Log in to Azure - CI subscription - name: Log in to Azure - CI subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0