Skip to content

Commit 7e7b9d4

Browse files
committed
Added verify.yml
1 parent 7649d0e commit 7e7b9d4

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "maven"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/verify.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Verify
2+
on: [pull_request]
3+
env:
4+
TERM: xterm-256color
5+
jobs:
6+
verify-commits:
7+
name: Check Commit Signatures
8+
runs-on: [self-hosted, build]
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Check signatures
15+
shell: bash
16+
env:
17+
GH_TOKEN: ${{ github.token }}
18+
run: |
19+
COMMITS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits \
20+
--jq '.[].sha') || {
21+
echo "::error::Failed to fetch commits from GitHub"
22+
exit 1
23+
}
24+
25+
if [ -z "$COMMITS" ]; then
26+
echo "::error::Unexpected empty commit list"
27+
exit 1
28+
fi
29+
30+
for sha in $COMMITS; do
31+
echo "Checking commit $sha"
32+
VERIFIED=$(gh api repos/${{ github.repository }}/commits/$sha --jq '.commit.verification.verified')
33+
if [ "$VERIFIED" != "true" ]; then
34+
echo "::error::Commit $sha is not verified"
35+
exit 1
36+
fi
37+
done

0 commit comments

Comments
 (0)