From 83acac3e43e7182bea66ae2add132aa4220eb92d Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Thu, 1 Feb 2024 08:06:07 -0700 Subject: [PATCH] fix(actions): specify branch on monorepo lockfile pusher (#26949) --- .github/workflows/update-monorepo-lockfiles.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-monorepo-lockfiles.yml b/.github/workflows/update-monorepo-lockfiles.yml index e5af99f861..052df96e1c 100644 --- a/.github/workflows/update-monorepo-lockfiles.yml +++ b/.github/workflows/update-monorepo-lockfiles.yml @@ -35,4 +35,5 @@ jobs: git config user.name "GitHub-Actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package-lock.json - git diff --staged --quiet || (git commit -m "Update lock file for Dependabot PR" -a && git push https://${{ github.token }}@github.com/${{ github.repository }}.git) + # Push the changes back to the branch if they exist, and pass if there are no changes + git diff --staged --quiet || (git commit -m "Update lock file for Dependabot PR" -a && git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} ${{github.head_ref}})