Skip to content

Commit cb5ea2f

Browse files
Fix benchmark workflow permissions
- Add proper permissions for contents, pages, and id-token - Remove manual gh-pages setup (benchmark-action handles this automatically) - Simplify workflow by letting benchmark-action manage the gh-pages branch
1 parent cb4638b commit cb5ea2f

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
- cron: '0 2 * * 0'
1313
workflow_dispatch:
1414

15+
permissions:
16+
contents: write
17+
pages: write
18+
id-token: write
19+
1520
jobs:
1621
benchmark:
1722
name: Performance Benchmark
@@ -63,29 +68,6 @@ jobs:
6368
echo "=== GitHub Actions format ==="
6469
head -20 benchmark-results-gh.json
6570
66-
- name: Setup gh-pages branch if needed
67-
run: |
68-
git config --global user.name 'github-action-benchmark'
69-
git config --global user.email 'github@users.noreply.github.com'
70-
71-
# Check if gh-pages exists remotely
72-
if ! git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
73-
echo "Creating gh-pages branch..."
74-
git checkout --orphan gh-pages
75-
git rm -rf .
76-
echo "# HSM Performance Benchmarks" > README.md
77-
echo "" >> README.md
78-
echo "Automated benchmark results for rust-hsm PKCS#11 operations." >> README.md
79-
echo "" >> README.md
80-
echo "Generated by [github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark)." >> README.md
81-
git add README.md
82-
git commit -m "Initialize gh-pages branch for benchmarks"
83-
git push origin gh-pages
84-
git checkout main
85-
echo "✓ Created gh-pages branch"
86-
else
87-
echo "✓ gh-pages branch already exists"
88-
fi
8971

9072
- name: Store benchmark result
9173
uses: benchmark-action/github-action-benchmark@v1

0 commit comments

Comments
 (0)