Switch authoring to JSON file and add build/verification actions

This commit is contained in:
Shmavon Gazanchyan
2022-08-29 21:18:20 +01:00
parent 300d0c33d5
commit 159aebfac2
9 changed files with 2290 additions and 282 deletions

26
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Build
on:
push:
branches:
- 'master'
paths:
- 'data.json'
- '.github/tpl.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16.x"
- name: Build
run: node .github/scripts/build.js
- name: Commit
run: |
git config --global user.name 'Shmavon Gazanchyan'
git config --global user.email 'MunGell@users.noreply.github.com'
git commit -am "Update README.md"
git push

38
.github/workflows/invalid.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Check on Invalid PR
on:
pull_request_target:
branches:
- master
paths-ignore:
- '.github/**'
- 'data.json'
- 'CONTRIBUTING.md'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This PR is not valid. Please read [contributing guidelines](https://github.com/MunGell/awesome-for-beginners/CONTRIBUTING.md).'
});
if (context.payload.pull_request.labels.indexOf('Invalid') === -1) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Invalid']
});
}
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
state: 'closed'
});