forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (34 loc) · 1.32 KB
/
lua-format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
name: Lua-format
on:
pull_request:
push:
jobs:
lua-formatter:
runs-on: ubuntu-latest
steps:
- name: Set up Git
if: ${{ github.ref != 'refs/heads/main' }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Actions checkout
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run EmmyLuaCodeStyle
if: ${{ github.ref != 'refs/heads/main' }}
run: >
curl -L -o /tmp/linux-x64.tar.gz https://github.com/CppCXY/EmmyLuaCodeStyle/releases/download/1.3.1/linux-x64.tar.gz && tar -xzf /tmp/linux-x64.tar.gz -C /tmp && /tmp/linux-x64/bin/CodeFormat format -c .editorconfig -w .
- name: Run add and commit
if: ${{ github.ref != 'refs/heads/main' }}
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: "Lua code format - (EmmyLuaCodeStyle)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}