Skip to content

Commit

Permalink
fix: condition for branch target changed to be either ref or workflow…
Browse files Browse the repository at this point in the history
… ref
  • Loading branch information
gentlementlegen committed Jan 15, 2025
1 parent 86e316f commit 82bd846
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
environment: ${{ (github.ref == 'refs/heads/main' || github.event.workflow_run.head_branch == 'main') && 'main' || 'development' }}
permissions:
contents: write

Expand All @@ -32,7 +32,7 @@ jobs:

- name: Update wrangler.toml Name Field
run: |
branch_name=$(echo '${{ github.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
branch_name=$(echo '${{ github.event.workflow_run.head_branch || github.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
# Extract base name from wrangler.toml
base_name=$(grep '^name = ' wrangler.toml | sed 's/^name = "\(.*\)"$/\1/')
# Concatenate branch name with base name
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
files: |
manifest.json
commit-message: "chore: [skip ci] update manifest.json url"
ref: ${{ github.ref }}
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

- name: Write Deployment URL to Summary
run: |
Expand Down

0 comments on commit 82bd846

Please sign in to comment.