Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: condition for branch target changed to be either ref or workflow ref #126

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading