Files
cocos4/.github/workflows/interface-check.yml
T
PP 7ccccab1ee change to pull_request_target for Interface Check (#9705)
* change to pull_request_target

* checkout SHA
2021-11-23 11:06:41 +08:00

49 lines
1.3 KiB
YAML

name: interface check
#on: push
on: [pull_request_target]
jobs:
interface_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: npm install
run: |
npm install --ignore-scripts
- name: build HEAD declaration
run: |
npm run build-declaration
cp ./bin/.declarations/cc.d.ts ./bin/cc_head.d.ts
- name: git checkout to base branch
run: |
base_branch=`echo ${{ github.base_ref }} | awk -F'/' '{print $NF}'`
git fetch origin ${base_branch}
git checkout remotes/origin/${base_branch}
- name: build base declaration
run: |
npm run build-declaration
- uses: LouisBrunner/diff-action@v0.1.2
with:
old: ./bin/.declarations/cc.d.ts
new: ./bin/cc_head.d.ts
mode: addition
tolerance: worse
output: ./interface-diff.txt
- name: optimize interface check report
run: |
cat ./interface-diff.txt
node ./.github/workflows/interface-check-report.js
- uses: marocchino/sticky-pull-request-comment@v2
with:
path: ./interface-diff.txt