From 37ecbf5059355e38753afe8daafdc55d444ee517 Mon Sep 17 00:00:00 2001 From: Lewis Larsen Date: Sun, 29 Dec 2024 18:18:31 +0000 Subject: [PATCH] wip --- .github/workflows/duster-fix-blame.yml | 9 ++++++--- .github/workflows/prettier.yml | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/duster-fix-blame.yml b/.github/workflows/duster-fix-blame.yml index 7901bde6..401baca4 100644 --- a/.github/workflows/duster-fix-blame.yml +++ b/.github/workflows/duster-fix-blame.yml @@ -19,10 +19,11 @@ jobs: echo "github.head_ref: ${{ github.head_ref }}" echo "github.ref: ${{ github.ref }}" - - uses: actions/checkout@v4 + - name: Checkout Code + uses: actions/checkout@v4 with: - # Ensure that the correct branch is being checked out for PRs - ref: ${{ github.head_ref }} + # Ensure that the correct branch is being checked out for PRs or normal branches + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} - name: "Duster Fix" uses: tighten/duster-action@v3 @@ -35,6 +36,7 @@ jobs: commit_message: "style: automated changes to code style" commit_user_name: GitHub Action commit_user_email: actions@github.com + branch: ${{ github.event.pull_request.head.ref || github.ref_name }} - name: Ignore Duster commit in git blame if: steps.auto_commit_action.outputs.changes_detected == 'true' @@ -45,3 +47,4 @@ jobs: commit_message: "ci: ignoring commit change in git blame" commit_user_name: GitHub Action commit_user_email: actions@github.com + branch: ${{ github.event.pull_request.head.ref || github.ref_name }} diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 99795382..3cbe9649 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -6,10 +6,18 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Debug Ref Context + run: | + echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}" + echo "github.ref_name: ${{ github.ref_name }}" + echo "github.head_ref: ${{ github.head_ref }}" + echo "github.ref: ${{ github.ref }}" + + - name: Checkout Code + uses: actions/checkout@v4 with: - # Ensure that the correct ref is being used for PRs or normal branches - ref: ${{ github.head_ref || github.ref_name }} + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} + - uses: actions/setup-node@v4 with: node-version: "20.x" @@ -21,4 +29,4 @@ jobs: commit_message: "style: automated changes to blade files" commit_user_name: GitHub Action commit_user_email: actions@github.com - branch: ${{ github.head_ref || github.ref_name }} + branch: ${{ github.event.pull_request.head.ref || github.ref_name }}