feat(): 替换前端埋点接口 #1120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update docs etc | |
on: | |
pull_request: | |
types: [labeled] | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
# Only if it contains a certain label. | |
if: "contains( github.event.pull_request.labels.*.name, 'eve: update docs etc')" | |
steps: | |
- name: Update labels | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GH_TOKEN_EVE }} | |
script: | | |
await github.rest.issues.removeLabel({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
name: 'eve: update docs etc', | |
}); | |
await github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
labels: ['[bot]: updating docs etc'], | |
}); | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN_EVE }} | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- run: git checkout --track origin/${{ github.event.pull_request.head.ref }} | |
- run: | | |
git config --global user.name 'easyops-eve' | |
git config --global user.email '[email protected]' | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
cache: yarn | |
- name: Cache nx cache | |
uses: actions/cache@v3 | |
with: | |
path: .cache | |
key: ${{ runner.os }}-nx-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-nx- | |
- run: yarn install --frozen-lockfile | |
- name: Build and update docs etc | |
run: >- | |
lerna run build --scope @next-core/brick-types --include-dependencies | |
|| lerna run docs:dev --scope @next-core/brick-types | |
lerna run build --scope @next-core/brick-kit --include-dependencies | |
|| lerna run docs:dev --scope @next-core/brick-kit | |
- name: Git commit and push | |
run: | | |
git add -A | |
git commit -m "chore(): update docs etc" | |
git push | |
- name: Post update labels | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GH_TOKEN_EVE }} | |
script: | | |
await github.rest.issues.removeLabel({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
name: '[bot]: updating docs etc', | |
}); | |
await github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
labels: ['[bot]: updated docs etc'], | |
}); |