-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (59 loc) · 2.13 KB
/
Copy pathsetup.yaml
File metadata and controls
73 lines (59 loc) · 2.13 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
name: setup
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/setup.yaml'
env:
ULTRALYTICS_SOURCE: "CHAINGUARD"
permissions: {}
jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Setup Git
run: |
git config --global user.email "gha@users.noreply.github.com"
git config --global user.name "github-actions"
- uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0
id: octo-sts
with:
scope: chainguard-dev/libraries-ultralytics-attack-demo
identity: setup
- name: Select analysis directory and populate src/ultralytics
id: pick-dir
run: |
rm -rf src/ultralytics/*
mkdir -p src/ultralytics/
case "${ULTRALYTICS_SOURCE}" in
CHAINGUARD)
echo "Ultralytics src set to Chainguard Libraries"
rsync -av --ignore-times vendor/ultralytics-before-attack/* src/ultralytics/
rsync -av --ignore-times vendor/ultralytics-chainguard/* src/ultralytics/
;;
PYPI)
echo "Ultralytics src set to PYPI"
rsync -av --ignore-times vendor/ultralytics-before-attack/* src/ultralytics/
rsync -av --ignore-times vendor/malcontent-samples-ultralytics/v8.3.41/* src/ultralytics/
;;
*)
echo "❌ Unknown ULTRALYTICS_SOURCE value: '${ULTRALYTICS_SOURCE}'"
echo "Valid values: PYPI, CHAINGUARD"
exit 1
;;
esac
git add src/ultralytics/
git commit --allow-empty -m "reset src/ultralytics"
git push origin HEAD