-
Notifications
You must be signed in to change notification settings - Fork 42
47 lines (41 loc) · 1.29 KB
/
run-tests.yml
File metadata and controls
47 lines (41 loc) · 1.29 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
name: Run Tests and Notify Discord
on:
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/codegen-and-test
pr-notification:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Extract PR Metadata
uses: actions/github-script@v6
id: get_pr_data
with:
script: |
const pr = context.payload.pull_request;
core.setOutput('title', pr.title);
core.setOutput('body', pr.body);
core.setOutput('url', pr.html_url);
- name: Debug PR Data Outputs
run: |
echo "Title: ${{ steps.get_pr_data.outputs.title }}"
echo "Body: ${{ steps.get_pr_data.outputs.body }}"
echo "URL: ${{ steps.get_pr_data.outputs.url }}"
- uses: ./.github/actions/discord-webhook
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
pr-title: ${{ steps.get_pr_data.outputs.title }}
pr-body: ${{ steps.get_pr_data.outputs.body }}
pr-url: ${{ steps.get_pr_data.outputs.url }}