Skip to content

Commit

Permalink
test: lua format from fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Costallat committed Aug 15, 2024
1 parent 5dba7b4 commit 5fef058
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/lua-format-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/lua-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
version: latest
args: .

- name: Run add and commit
- name: Run add and commit from local branches
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: EndBug/add-and-commit@v9
with:
Expand Down

0 comments on commit 5fef058

Please sign in to comment.