From 38abd3f6d149998ba8c3246a1b2a641c22119e26 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Thu, 19 Dec 2024 00:41:32 +0530 Subject: [PATCH] Test committing changes as current actor --- .github/workflows/todo-to-issue.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 5e3eef9171..530ddf1c65 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -17,8 +17,9 @@ name: "Run TODO to Issue" on: push: - branches: - - replace-with-master-when-fixed + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: build: @@ -26,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + ref: ${{ github.head_ref }} - name: "TODO to Issue" uses: alstr/todo-to-issue-action@v5.1.7 with: @@ -35,14 +36,15 @@ jobs: CLOSE_ISSUES: "true" - name: Set Git user run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name ${{ github.actor }} + # git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Commit and Push Changes run: | + echo "// new change" >> ground/src/main/java/com/google/android/ground/GroundApplication.kt git add -A if [[ `git status --porcelain` ]]; then git commit -m "Automatically added GitHub issue links to TODOs" - git push origin master + git push origin ${{ github.head_ref }} else echo "No changes to commit" fi \ No newline at end of file