-
Notifications
You must be signed in to change notification settings - Fork 174
74 lines (71 loc) · 2.65 KB
/
open.yml
File metadata and controls
74 lines (71 loc) · 2.65 KB
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
name: Data check
on:
pull_request_target:
types: [opened]
permissions:
contents: read
jobs:
comment-on-pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const prNumber = context.issue.number;
const url = `https://vatsim-radar.com/data/vatspy/${prNumber}/compare`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Validate data: ${url}\n\nFor controllers data testing visit https://docs.vatsim-radar.com/contributing/debug.html`
})
contributor-data:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.check-contributor.outputs.result }}
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install deps
shell: sh
working-directory: ./scripts
run: yarn
- id: check-contributor
name: Run contributor check
shell: bash
working-directory: ./scripts
run: |
OUTPUT=$(yarn check-contributor --login="${{ github.event.pull_request.user.login }}")
echo "result<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
contributor-comment:
runs-on: ubuntu-latest
needs: contributor-data
permissions:
pull-requests: write
issues: write
contents: read
steps:
- uses: actions/github-script@v7
with:
script: |
const result = `${{ needs.contributor-data.outputs.result }}`;
const pr = context.issue.number;
const msg = result !== "not found"
? result
: `❌ Github login ${context.payload.pull_request.user.login} was not found in [contributor list](https://docs.google.com/spreadsheets/u/4/d/e/2PACX-1vRHzHhKz4icslNkd3I6mF1Mp_6gan4muRcWZb8fCYL8_S0C6GDpG409xQGTmPAXLPupEWWws3euNK7O/pubhtml?gid=0). Please read [Readme](https://github.com/vatsimnetwork/vatspy-data-project?tab=readme-ov-file#approved-contributors) to learn more.\n\nKeep in mind: this message will not update automatically. Please, re-run \`validate-contributor\` job when this will be solved.`;
await github.rest.issues.createComment({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo,
body: msg
});