-
-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathgenerate_algorithm_families.yml
More file actions
65 lines (53 loc) · 2.25 KB
/
Copy pathgenerate_algorithm_families.yml
File metadata and controls
65 lines (53 loc) · 2.25 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
name: Generate Algorithm Families Enum
on:
push:
paths:
- 'schema/cryptography-defs.json'
- 'tools/src/main/python/algorithmFamilyGeneration.py'
workflow_dispatch:
jobs:
generate-families:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: Set up Python
# see https://github.com/actions/setup-python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.x'
- name: Run algorithm family generator
working-directory: tools/src/main/python
run: python3 algorithmFamilyGeneration.py
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="update-algorithm-families"
# Configure Git
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Check for changes
if git diff --quiet schema/cryptography-defs.schema.json; then
echo "No changes to algorithm families"
exit 0
fi
# Create branch and commit
git checkout -b "$BRANCH_NAME"
git add schema/cryptography-defs.schema.json
git commit -m "chore: update algorithm families [skip ci]"
# Push to the branch (use GH_TOKEN for authentication)
git push -u "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "$BRANCH_NAME" --force
# Create Pull Request using GitHub CLI (gh)
gh pr create \
--title "chore: update algorithm families" \
--body "This PR updates \`schema/cryptography-defs.schema.json\` with the latest algorithm families generated from \`schema/cryptography-defs.json\`." \
--base "master" \
--head "$BRANCH_NAME" || echo "Pull request already exists"