-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (68 loc) · 2.34 KB
/
Copy pathci.yml
File metadata and controls
76 lines (68 loc) · 2.34 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
75
76
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 22
cache: npm
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: "3.11"
- run: npm ci --ignore-scripts
- run: npm run ci
- run: pip install skylos
- run: skylos . -a --format json --output skylos-results.json
- run: skylos . --gate
- run: node scripts/update-skylos-badge.mjs skylos-results.json
skylos-badge:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: "3.11"
- run: pip install skylos
- run: skylos . -a --format json --output skylos-results.json
- run: node scripts/update-skylos-badge.mjs skylos-results.json
- name: Create or update PR for Skylos badge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if git diff --quiet -- .github/badges/skylos.json; then
echo "Skylos badge already up to date."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
BRANCH="chore/update-skylos-badge-$(date +%s)"
git checkout -b "$BRANCH"
git add .github/badges/skylos.json
git commit -m "docs: update Skylos badge"
git push origin "$BRANCH"
gh pr create \
--title "docs: update Skylos badge" \
--body "Automated Skylos badge update." \
--base main \
--head "$BRANCH" \
--label "docs,automated" || true
echo "Opened PR for Skylos badge update from branch $BRANCH"