Reformat code #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Reformat code | |
on: | |
workflow_dispatch: | |
inputs: | |
file_mask: | |
description: 'File mask to reformat' | |
required: true | |
default: '*.java,*.kts,*.kt' | |
direct-commit: | |
type: boolean | |
default: false | |
description: Commit directly to source (instead of opening a PR) | |
jobs: | |
reformat: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout repository | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Do reformat | |
uses: leventeBajczi/[email protected] | |
with: | |
settings-file: "./doc/ThetaIntelliJCodeStyle.xml" | |
file-mask: ${{ inputs.file_mask }} | |
- name: Create Pull Request | |
if: ${{ !inputs.direct-commit }} | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 | |
with: | |
commit-message: "Reformatted code" | |
branch: "code-reformat" | |
title: '[AutoPR] Reformatted code' | |
token: ${{ steps.generate-token.outputs.token }} | |
committer: ThetaBotMaintainer[bot] <139346997+ThetaBotMaintainer[bot]@users.noreply.github.com> | |
author: ThetaBotMaintainer[bot] <139346997+ThetaBotMaintainer[bot]@users.noreply.github.com> | |
- name: Commit changes | |
if: ${{ inputs.direct-commit }} | |
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a | |
with: | |
commit_message: "Reformatted code" | |
commit_user_name: ThetaBotMaintainer[bot] | |
commit_user_email: 139346997+ThetaBotMaintainer[bot]@users.noreply.github.com | |
commit_author: ThetaBotMaintainer[bot] <139346997+ThetaBotMaintainer[bot]@users.noreply.github.com> |