-
Notifications
You must be signed in to change notification settings - Fork 26
69 lines (61 loc) · 2.11 KB
/
check-sample.yml
File metadata and controls
69 lines (61 loc) · 2.11 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
name: Check Samples
on:
pull_request:
paths:
- "samples/**"
jobs:
check_samples:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Fetch two to see changes in current commit
fetch-depth: 2
- name: Install Defang (nightly)
run: |
eval "$(curl -fsSL s.defang.io/install)"
env:
DEFANG_INSTALL_VERSION: nightly
- name: Run Checks
id: checks
run: |
./scripts/check-sample-files.sh > checklist.txt
./scripts/check-modified-samples.sh > modified.txt
echo "@@ MODIFIED @@"
cat modified.txt
echo "@@ CHECKLIST @@"
cat checklist.txt
# TODO: Uncomment the following lines to validate the Compose files
# once we figure out how to prevent it from erroring on warnings.
# - name: Validate Compose Files with Defang CLI
# run: |
# eval "$(curl -fsSL s.defang.io/install)"
# cat modified.txt | xargs -n1 defang compose config -C > /dev/null
- name: Add checklist to PR description
uses: actions/github-script@v7
with:
script: |
const script = require('./scripts/add-checklist-to-pr.js');
try {
await script({github, context});
core.info(`Checklist successfully added to PR description`);
} catch (error) {
core.setFailed(`Script execution failed: ${error.message}`);
}
- name: Install script dependencies
run: npm ci
working-directory: scripts
- name: Create / Update Template Repo
uses: actions/github-script@v7
env:
PUSH_TOKEN: ${{ secrets.TEMPLATES_MANAGER_TOKEN }}
with:
github-token: ${{ secrets.TEMPLATES_MANAGER_TOKEN }}
script: |
const script = require('./scripts/template-manager.js')
const output = await script({github, context, core});
console.log("@@ output", output)