Skip to content

Commit 68d1c34

Browse files
committed
🚑 ci: fix workflow dependencies
1 parent 37ede50 commit 68d1c34

2 files changed

Lines changed: 40 additions & 13 deletions

File tree

.github/workflows/commit-sentinel.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,42 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525

26-
- name: Ensure commits are signed
27-
uses: zgosalvez/github-actions-ensure-commit-signed@v1
28-
with:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Trust soo-bak signing key
27+
shell: bash
28+
run: |
29+
set -euo pipefail
30+
mkdir -p ~/.ssh
31+
cat <<'EOF' > ~/.ssh/allowed_signers
32+
soo-bak@github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwMav68GMpY0c5ZkVv859NppHgfzMfrCYyQuByZwNtq
33+
EOF
34+
git config --global gpg.format ssh
35+
git config --global gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers
36+
37+
- name: Enforce signed commits
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
if [ "${{ github.event_name }}" = "pull_request" ]; then
42+
range="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
43+
elif [ -n "${{ github.event.before }}" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
44+
range="${{ github.event.before }}..${{ github.sha }}"
45+
else
46+
range="${{ github.sha }}"
47+
fi
48+
49+
while read -r commit; do
50+
if ! git verify-commit "$commit" >/dev/null 2>&1; then
51+
echo "::error::Commit $commit lacks a trusted signature" >&2
52+
exit 1
53+
fi
54+
done < <(git rev-list "$range")
3055
3156
- name: Lint commit titles
3257
shell: pwsh
3358
run: |
3459
$eventName = '${{ github.event_name }}'
3560
if ($eventName -eq 'pull_request') {
36-
$base = '${{ github.event.pull_request.base.sha }}'
37-
$head = '${{ github.event.pull_request.head.sha }}'
38-
$range = "$base..$head"
61+
$range = '${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}'
3962
} else {
4063
$before = '${{ github.event.before }}'
4164
$after = '${{ github.sha }}'

.github/workflows/unity-editmode.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,23 @@ jobs:
2626
editmode:
2727
name: EditMode Regression
2828
runs-on: ubuntu-latest
29-
timeout-minutes: 30
29+
timeout-minutes: 40
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333
with:
3434
lfs: true
3535
fetch-depth: 0
3636

37-
- name: Install Unity
38-
uses: game-ci/unity-setup@v4
39-
with:
40-
unityVersion: ${{ env.UNITY_VERSION }}
41-
githubToken: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Guard license secret
38+
if: ${{ env.TEST_PLATFORM == 'EditMode' }}
39+
shell: bash
40+
run: |
41+
set -euo pipefail
42+
if [ -z "${UNITY_LICENSE:-}" ]; then
43+
echo "::error::UNITY_LICENSE secret is required for EditMode automation." >&2
44+
exit 1
45+
fi
4246
4347
- name: Cache Library
4448
uses: actions/cache@v4

0 commit comments

Comments
 (0)