From bd1c2f56259f7548a0450f8c20370b9ddcdedfe2 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 17 Dec 2024 17:44:04 +0530 Subject: [PATCH 1/6] Remove PAT --- .github/workflows/todo-to-issue.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 5d34f6381b..19d28846d4 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -25,8 +25,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: "TODO to Issue" uses: alstr/todo-to-issue-action@v5.1.7 with: From cc60c17121a31cad2f06b0e9d8eb376da287967f Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 17 Dec 2024 18:28:31 +0530 Subject: [PATCH 2/6] Test changes to commit changes --- .github/workflows/todo-to-issue.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 19d28846d4..517459db82 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -16,9 +16,8 @@ name: "Run TODO to Issue" on: - push: - branches: - - master + pull_request: + branches: [ "master" ] jobs: build: @@ -37,10 +36,12 @@ jobs: 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 + echo "branch " ${{ github.head_ref || github.ref_name }} 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 From a69ba0dfd8d4e5c050c59d387c13676955f29c00 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 17 Dec 2024 18:31:48 +0530 Subject: [PATCH 3/6] Checkout current branch --- .github/workflows/todo-to-issue.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 517459db82..0e181d8898 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -24,6 +24,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: "TODO to Issue" uses: alstr/todo-to-issue-action@v5.1.7 with: From 3f776deb6961c978aa68fca95ecdf6400e6e1e6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 17 Dec 2024 13:02:15 +0000 Subject: [PATCH 4/6] Automatically added GitHub issue links to TODOs --- .../src/main/java/com/google/android/ground/GroundApplication.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/src/main/java/com/google/android/ground/GroundApplication.kt b/ground/src/main/java/com/google/android/ground/GroundApplication.kt index f3e1474a73..07658e2090 100644 --- a/ground/src/main/java/com/google/android/ground/GroundApplication.kt +++ b/ground/src/main/java/com/google/android/ground/GroundApplication.kt @@ -66,3 +66,4 @@ class GroundApplication : MultiDexApplication(), Configuration.Provider { } } } +// new change From 0213333959a23818a307d955323270709065b149 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 17 Dec 2024 18:33:51 +0530 Subject: [PATCH 5/6] Remove test changes --- .github/workflows/todo-to-issue.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 0e181d8898..9e689f0aef 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -38,8 +38,6 @@ jobs: 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 - echo "branch " ${{ github.head_ref || github.ref_name }} git add -A if [[ `git status --porcelain` ]]; then git commit -m "Automatically added GitHub issue links to TODOs" From 10931f0e425ff9ecb9960ba755fcdc556367cce5 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 17 Dec 2024 18:43:33 +0530 Subject: [PATCH 6/6] Also run on push to master to auto-close issue --- .github/workflows/todo-to-issue.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/todo-to-issue.yml b/.github/workflows/todo-to-issue.yml index 9e689f0aef..a2a6c8c3b4 100644 --- a/.github/workflows/todo-to-issue.yml +++ b/.github/workflows/todo-to-issue.yml @@ -16,6 +16,8 @@ name: "Run TODO to Issue" on: + push: + branches: [ "master" ] pull_request: branches: [ "master" ]