diff --git a/.github/workflows/formatting-checks.yml b/.github/workflows/formatting-checks.yml index 3918002..31e7f45 100644 --- a/.github/workflows/formatting-checks.yml +++ b/.github/workflows/formatting-checks.yml @@ -2,6 +2,7 @@ name: Formatting Check on: push: + pull_request: jobs: format-check: diff --git a/.github/workflows/worker-delete.yml b/.github/workflows/worker-delete.yml index 5a9a43c..3cf2edb 100644 --- a/.github/workflows/worker-delete.yml +++ b/.github/workflows/worker-delete.yml @@ -7,7 +7,7 @@ jobs: delete: runs-on: ubuntu-latest name: Delete Deployment - environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }} + environment: ${{ (github.ref == 'refs/heads/main' || github.event.workflow_run.head_branch == 'main') && 'main' || 'development' }} steps: - name: Setup Node uses: actions/setup-node@v4 @@ -22,7 +22,7 @@ jobs: - name: Get Deleted Branch Name id: get_branch run: | - branch_name=$(echo '${{ github.event.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') echo "branch_name=$branch_name" >> $GITHUB_ENV - name: Retrieve and Construct Full Worker Name id: construct_worker_name diff --git a/.github/workflows/worker-deploy.yml b/.github/workflows/worker-deploy.yml index 107d781..f3d504f 100644 --- a/.github/workflows/worker-deploy.yml +++ b/.github/workflows/worker-deploy.yml @@ -15,16 +15,11 @@ 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 steps: - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20.10.0" - - uses: actions/checkout@v4 - name: Setup Bun @@ -32,7 +27,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 @@ -101,7 +96,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: | diff --git a/wrangler.toml b/wrangler.toml index ffd3573..3a3a194 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -6,4 +6,7 @@ compatibility_flags = [ "nodejs_compat" ] [env.prod] [observability] -enabled = true \ No newline at end of file +enabled = true + +[version_metadata] +binding = "CLOUDFLARE_VERSION_METADATA" \ No newline at end of file