-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.55 KB
/
api-reviewer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: API Reviewer
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Flatten current PR custom-elements.json
run: |
# node ${{ github.workspace }}/.github/actions/test.cjs --file-name=flat-manifest-pr
- name: Save current PR custom-elements.json
id: pr_file
run: echo "::set-output name=flat-manifest-pr::$(cat flat-manifest-pr.json)"
- uses: actions/checkout@v4
with:
ref: main
- name: Flatten origin/main branch custom-elements.json
run: |
# node ${{ github.workspace }}/.github/actions/test.cjs --file-name=flat-manifest-main
- name: Create current PR custom-elemnts.json in main branch
run: |
echo "${{ steps.pr_file.outputs.flat-manifest-pr }}" > flat-manifest-pr.json
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18" # Use your desired version
- name: Install dependencies
run: |
npm install @octokit/rest # Install Octokit to interact with GitHub API
- name: Run Node.js script
run: |
node ${{ github.workspace }}/.github/actions/test2.cjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token with write permissions
GITHUB_REPOSITORY: ${{ github.repository }} # Set repository name
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} # Set repository owner
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}