-
Notifications
You must be signed in to change notification settings - Fork 53
28 lines (25 loc) · 1 KB
/
build.yml
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
name: Build of the database
on:
pull_request:
types: [opened, synchronize]
jobs:
rebuild-database:
# Only run it on extensions submissions (tag is ensured via the new issue form)
if: ${{ contains(github.event.pull_request.labels.*.name, '✨ New extension') || contains(github.event.pull_request.labels.*.name, '🔄 Extension update') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Rebuild the database
run: |
npm install
echo 'BUILD_LOGS<<EOF' >> $GITHUB_ENV
node scripts/generate-extensions-registry.js --disable-exit-code >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Notify build errors
if: ${{ !contains(env.BUILD_LOGS, 'successfully updated') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "Errors were detected in this submission:
\`\`\`${{ env.BUILD_LOGS }}
\`\`\`"