-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (36 loc) · 1.14 KB
/
PrQuality.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
name: Pull Request Quality
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
quality:
name: Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Deps
run: bun install
- name: Check Formatting
run: bunx dprint check
- name: Check Astro Website for Major Issues
run: bunx astro check
- name: Post failure message
if: failure()
uses: actions/github-script@v5
with:
script: |
const { owner, repo } = context.repo;
const prNumber = context.issue.number;
// Constructing the URL to the logs for the current run
const logsUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`;
await github.rest.issues.createComment({
owner,
repo,
issue_number: prNumber,
body: `The quality check has failed. Please review the changes.\n\n[View Logs](${logsUrl})`,
});