From 5fef0587268bb2415e41b218df4cd25d2c2dd97f Mon Sep 17 00:00:00 2001 From: Renato Foot Date: Thu, 15 Aug 2024 17:58:42 +0000 Subject: [PATCH] test: lua format from fork --- .github/workflows/lua-format-workflow.yml | 39 +++++++++++++++++++++++ .github/workflows/lua-format.yml | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lua-format-workflow.yml diff --git a/.github/workflows/lua-format-workflow.yml b/.github/workflows/lua-format-workflow.yml new file mode 100644 index 00000000000..ba061f89135 --- /dev/null +++ b/.github/workflows/lua-format-workflow.yml @@ -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 }} diff --git a/.github/workflows/lua-format.yml b/.github/workflows/lua-format.yml index 57181274f54..056eafbac42 100644 --- a/.github/workflows/lua-format.yml +++ b/.github/workflows/lua-format.yml @@ -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: