feat(ci): use stylua action
This commit is contained in:
14
.github/workflows/format.yml
vendored
14
.github/workflows/format.yml
vendored
@@ -17,22 +17,20 @@ jobs:
|
|||||||
STYLUA_VERSION: 0.12.2
|
STYLUA_VERSION: 0.12.2
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
|
|
||||||
- name: Setup git
|
- name: Setup git
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
printf 'STYLE_BRANCH=bot/style/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
|
printf 'STYLE_BRANCH=bot/style/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Apply stylua
|
|
||||||
run: |
|
|
||||||
git checkout -b ${STYLE_BRANCH}
|
git checkout -b ${STYLE_BRANCH}
|
||||||
curl -Lo /tmp/stylua.zip https://github.com/JohnnyMorganz/StyLua/releases/download/v${STYLUA_VERSION}/stylua-${STYLUA_VERSION}-linux.zip
|
|
||||||
unzip -d /tmp/ /tmp/stylua.zip
|
|
||||||
chmod +x /tmp/stylua
|
|
||||||
/tmp/stylua --config-path=.stylua.toml lua/
|
|
||||||
|
|
||||||
|
- uses: JohnnyMorganz/stylua-action@1.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
args: --check lua
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
- name: Apply prettier
|
- name: Apply prettier
|
||||||
run: |
|
run: |
|
||||||
npm install -g prettier
|
npm install -g prettier
|
||||||
|
|||||||
Reference in New Issue
Block a user