forked from crowdsecurity/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 1.9 KB
/
Copy pathupdate-index.yml
File metadata and controls
75 lines (67 loc) · 1.9 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
name: Update index
on:
push:
branches:
- "master"
- "v[0-9]+.[0-9]+.[0-9]+*"
- "test*"
paths:
- 'appsec-configs/**.md'
- 'appsec-configs/**.yaml'
- 'appsec-configs/**.yml'
- 'appsec-rules/**.md'
- 'appsec-rules/**.yaml'
- 'appsec-rules/**.yml'
- 'collections/**.md'
- 'collections/**.yaml'
- 'collections/**.yml'
- 'contexts/**.md'
- 'contexts/**.yaml'
- 'contexts/**.yml'
- 'parsers/**.md'
- 'parsers/**.yaml'
- 'parsers/**.yml'
- 'postoverflows/**.md'
- 'postoverflows/**.yaml'
- 'postoverflows/**.yml'
- 'scenarios/**.md'
- 'scenarios/**.yaml'
- 'scenarios/**.yml'
- '.github/workflows/update-index.yml'
- "src/**"
- "pyproject.toml"
- "uv.lock"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.5.24
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: set up python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: update .index.json
run: |
uv sync --all-extras --dev --locked
uv run mkindex
- uses: nelonoel/branch-name@v1.0.1
- name: Commit files
if: ${{ github.event_name == 'push'}}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update index" .index.json || exit 0
git pull --rebase origin ${BRANCH_NAME}
- name: Push changes
if: ${{ github.event_name == 'push'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}