diff --git a/.github/workflows/comment-command.yml b/.github/workflows/comment-command.yml new file mode 100644 index 0000000000..2f54739022 --- /dev/null +++ b/.github/workflows/comment-command.yml @@ -0,0 +1,54 @@ +name: Comment Commands +on: + issue_comment: + types: [ created ] + +jobs: + wpiformat: + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/wpiformat') + runs-on: ubuntu-latest + steps: + - name: React Rocket + uses: actions/github-script@v4 + with: + script: | + const {owner, repo} = context.issue + github.reactions.createForIssueComment({ + owner, + repo, + comment_id: context.payload.comment.id, + content: "rocket", + }); + - uses: actions/checkout@v2 + - name: Fetch all history and metadata + run: | + git fetch --prune --unshallow + git checkout -b pr + git branch -f main origin/main + - name: Checkout PR + run: | + gh pr checkout $NUMBER + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + NUMBER: ${{ github.event.issue.number }} + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install clang-format + run: | + sudo sh -c "echo 'deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe' >> /etc/apt/sources.list.d/proposed-repositories.list" + sudo apt-get update -q + sudo apt-get install -y clang-format-12 + - name: Install wpiformat + run: pip3 install wpiformat + - name: Run wpiformat + run: wpiformat -clang 12 + - 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 "wpiformat" + git push diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 91bff89a1a..33d5b847a5 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -14,7 +14,6 @@ jobs: wpiformat: name: "wpiformat" runs-on: ubuntu-latest - container: wpilib/roborio-cross-ubuntu:2022-20.04 steps: - uses: actions/checkout@v2 - name: Fetch all history and metadata