Skip to content

Lua-format-workflow

Lua-format-workflow #2

---
name: Lua-format-workflow
on:
workflow_run:
workflows: ["Lua-format"]
types: [completed]
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.repository.full_name != github.repository }}
steps:
- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Actions checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: ${{ github.event.workflow_run.head_branch }}
ref: ${{ github.event.workflow_run.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: .
- name: Run add and commit
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: "Lua code format - (Stylua)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}