2020 uses : actions/checkout@v6
2121 with :
2222 token : ${{ secrets.GITHUB_TOKEN }}
23+ persist-credentials : false
2324
2425 - name : Set up Python
2526 uses : actions/setup-python@v5
@@ -31,12 +32,32 @@ jobs:
3132 run : python3 algorithmFamilyGeneration.py
3233
3334 - name : Create Pull Request
34- uses : peter-evans/create-pull-request@v6
35- with :
36- token : ${{ secrets.GITHUB_TOKEN }}
37- commit-message : " chore: update algorithm families [skip ci]"
38- branch : " update-algorithm-families"
39- title : " chore: update algorithm families"
40- body : " This PR updates `schema/cryptography-defs.schema.json` with the latest algorithm families generated from `schema/cryptography-defs.json`."
41- base : " master"
42- delete-branch : true
35+ env :
36+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37+ run : |
38+ BRANCH_NAME="update-algorithm-families"
39+
40+ # Configure Git
41+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
42+ git config --local user.name "github-actions[bot]"
43+
44+ # Check for changes
45+ if git diff --quiet schema/cryptography-defs.schema.json; then
46+ echo "No changes to algorithm families"
47+ exit 0
48+ fi
49+
50+ # Create branch and commit
51+ git checkout -b "$BRANCH_NAME"
52+ git add schema/cryptography-defs.schema.json
53+ git commit -m "chore: update algorithm families [skip ci]"
54+
55+ # Push to the branch (use GH_TOKEN for authentication)
56+ git push -u "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "$BRANCH_NAME" --force
57+
58+ # Create Pull Request using GitHub CLI (gh)
59+ gh pr create \
60+ --title "chore: update algorithm families" \
61+ --body "This PR updates \`schema/cryptography-defs.schema.json\` with the latest algorithm families generated from \`schema/cryptography-defs.json\`." \
62+ --base "master" \
63+ --head "$BRANCH_NAME" || echo "Pull request already exists"
0 commit comments