From 2b2c705043b6e34715db546a86351bad34b090e7 Mon Sep 17 00:00:00 2001 From: Ishan <98932677+Ishan1522@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:38:46 -0500 Subject: [PATCH 1/4] comment command attempt part idk --- .github/workflows/comment-command.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/comment-command.yml diff --git a/.github/workflows/comment-command.yml b/.github/workflows/comment-command.yml new file mode 100644 index 0000000..5876c3b --- /dev/null +++ b/.github/workflows/comment-command.yml @@ -0,0 +1,58 @@ +name: Comment Commands +on: + issue_comment: + types: [ created ] + +jobs: + format: + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/format') + runs-on: ubuntu-22.04 + steps: + - name: React Rocket + uses: actions/github-script@v7 + with: + script: | + const {owner, repo} = context.issue + github.rest.reactions.createForIssueComment({ + owner, + repo, + comment_id: context.payload.comment.id, + content: "rocket", + }); + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.COMMENT_COMMAND_PAT_TOKEN }} + - name: Fetch all history and metadata + run: | + git checkout -b pr + git branch -f main origin/main + - name: Checkout PR + run: | + gh pr checkout $NUMBER + env: + GITHUB_TOKEN: "${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}" + NUMBER: ${{ github.event.issue.number }} + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Install wpiformat + run: pip3 install wpiformat==2024.45 + - name: Run wpiformat + run: wpiformat + - name: Run spotlessApply + run: ./gradlew spotlessApply + - name: Commit + run: | + # Set credentials + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + # Commit + git commit -am "Formatting fixes" + git push \ No newline at end of file From 6b9f83ee90e7f3ae4d9485e6043db275434d30b9 Mon Sep 17 00:00:00 2001 From: Ishan <98932677+Ishan1522@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:21:39 -0500 Subject: [PATCH 2/4] commit --- .github/workflows/comment-command.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/comment-command.yml b/.github/workflows/comment-command.yml index 5876c3b..f1262e2 100644 --- a/.github/workflows/comment-command.yml +++ b/.github/workflows/comment-command.yml @@ -42,10 +42,6 @@ jobs: with: distribution: 'temurin' java-version: 17 - - name: Install wpiformat - run: pip3 install wpiformat==2024.45 - - name: Run wpiformat - run: wpiformat - name: Run spotlessApply run: ./gradlew spotlessApply - name: Commit From 9b82c1b07dcff23e16114b2a64dd29c62499cb56 Mon Sep 17 00:00:00 2001 From: Ishan <98932677+Ishan1522@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:27:18 -0500 Subject: [PATCH 3/4] idk bro :sob: --- .github/workflows/comment-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/comment-command.yml b/.github/workflows/comment-command.yml index f1262e2..c57ab17 100644 --- a/.github/workflows/comment-command.yml +++ b/.github/workflows/comment-command.yml @@ -2,7 +2,7 @@ name: Comment Commands on: issue_comment: types: [ created ] - +workflow_dispatch: jobs: format: if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/format') From e907ecf7033da22c39a0ae8354e3ea8e8b8c6d36 Mon Sep 17 00:00:00 2001 From: Ishan <98932677+Ishan1522@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:30:14 -0500 Subject: [PATCH 4/4] fix --- .github/workflows/comment-command.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/comment-command.yml b/.github/workflows/comment-command.yml index c57ab17..3e7e5fc 100644 --- a/.github/workflows/comment-command.yml +++ b/.github/workflows/comment-command.yml @@ -2,7 +2,6 @@ name: Comment Commands on: issue_comment: types: [ created ] -workflow_dispatch: jobs: format: if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/format')