Avoid specifying branch unnecessarily · github/codeql-action@2afb4e6

Original file line numberDiff line numberDiff line change

@@ -69,11 +69,9 @@ jobs:

6969
7070

- name: Check for changes and push

7171

id: push

72-

env:

73-

BRANCH: ${{ github.event.pull_request.head.ref || github.event.ref }}

7472

run: |

7573

if [ ! -z "$(git status --porcelain)" ]; then

76-

echo "Changes detected, pushing them to branch $BRANCH"

74+

echo "Changes detected, committing and pushing."

7775

git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

7876

git config --global user.name "github-actions[bot]"

7977

git add --all

@@ -86,8 +84,8 @@ jobs:

8684

echo "No in-progress merge detected, committing changes."

8785

git commit -m "Rebuild"

8886

fi

89-

echo "Pushing changes to branch $BRANCH"

90-

git push origin "HEAD:$BRANCH"

87+

echo "Pushing changes"

88+

git push

9189

echo "changes=true" >> $GITHUB_OUTPUT

9290

else

9391

echo "No changes detected, nothing to commit."