From 5013ac62b8ba3793ac007517d44d19fcf5dfba4d Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 14 Nov 2024 01:46:25 +0530 Subject: [PATCH] Update checkout action and push command to use dynamic branch references --- .github/workflows/prettier.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 3fc5f8ed73..3576046b47 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -16,6 +16,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref || github.ref_name }} + fetch-depth: 0 - name: Set up Node.js uses: actions/setup-node@v2 @@ -46,4 +49,4 @@ jobs: git config user.email "${{ github.actor }}@users.noreply.github.com" git add . git commit -m "chore: format code with Prettier" - git push \ No newline at end of file + git push origin HEAD:${{ github.head_ref || github.ref_name }} \ No newline at end of file