Files
cocos4/.github/workflows/native-clang-format.yml
T
fish9167 89f51066d0 Change action triggers (#11773)
* [Change] change action event

* [Change] change action event

* [Change] change action event

* Update README.md

* Update README.md

Co-authored-by: jianping.yu <jianping.yu@cocos.com>
2022-06-30 16:05:17 +08:00

56 lines
1.6 KiB
YAML

name: <Native> Apply clang format
#on: [push, pull_request]
on:
pull_request_target:
types: [closed]
paths:
- 'templates/**'
- 'native/**'
jobs:
Clang-Format:
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ github.token }}
ref: ${{ github.head_sha }}
- id: get_change_files
uses: fish9167/file-changes-action@v1.2.3
with:
output: ' '
fileOutput: ' '
- name: Echo change files
run: |
cat $HOME/files.txt
mv $HOME/files.txt ${{github.workspace}}/files.txt
- uses: fish9167/clang-format-lint-action@master
with:
source: ./native
exclude: ./native/cocos/bindings/auto
extensions: 'c,h,hpp,cpp,cxx'
style: file
inplace: True
clangFormatVersion: 12
- name: Create Pull Request
uses: fish9167/create-pull-request@v3
with:
title: '[ci skip][AUTO]: Automated PR to fix formatting'
body: |
Automated PR to fix formatting
committer: cocos-robot <cocos-robot@cocos.com>
author: cocos-robot <cocos-robot@cocos.com>
commit-message: "[ci skip][AUTO]: Automated clang-format update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})"
token: ${{ secrets.PR_TOKEN }}
push-to-fork: cocos-robot/engine
branch: t/bot/fix-format
branch-suffix: short-commit-hash
delete-branch: true