-
Notifications
You must be signed in to change notification settings - Fork 68
81 lines (71 loc) · 2.44 KB
/
auto-pr-schemastore.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This worklofw will trigger on a push to main when the file "monika-config-schema.json" is updated
# 1. Checkout the schemastore fork
# 2. Refresh it from upstream
# 3. Create a PR for the json update
name: Auto PR to Schemastore/schemastore.git
on:
workflow_dispatch:
push:
paths:
- 'src/monika-config-schema.json' # only run the workflow if the schema file is changed
branches:
- main
env:
USERNAME: ${{ github.actor }}
EMAIL: ${{ github.actor}}@users.noreply.github.com
permissions:
issues: read
pull-requests: read
jobs:
create-auto-PR:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: SchemaStore/schemastore
token: ${{ secrets.AUTO_PR_TOKEN }}
ref: master
- name: Update schema file
run: |
cd src/schemas/json
rm monika-config-schema.json
wget https://raw.githubusercontent.com/hyperjumptech/monika/main/src/monika-config-schema.json
git config --global user.name "$USERNAME"
git config --global user.email "$EMAIL"
git add .
git commit -m "update json schema"
- name: ✍🏻 Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Run Test on Schema
run: |
cd src
npm ci
npm run build
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.AUTO_PR_TOKEN }}
commit-message: Update monika-config-schema
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
base: master
push-to-fork: hyperjumptech/schemastore
branch: feat/Update-monika-schema
title: '[PR] Update monika config schema'
body: |
In this PR:
- Update config json schema to improve suggestions
- Update keys, default values and properties.
draft: false
delete-branch: true
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
env:
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
run: |
echo "Pull Request Number - $PR_NUMBER"
echo "Pull Request URL - $PR_URL"