-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (58 loc) · 2.05 KB
/
Verify.Redist.Update.yaml
File metadata and controls
66 lines (58 loc) · 2.05 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
66
name: "Verify.Redist.Update"
on:
pull_request:
branches:
- master
paths:
- 'redist/**'
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
verify:
name: "Verify Redist Update"
runs-on: ubuntu-latest
env:
ALLOW_AUTO_MERGE_REDIST_PR: ${{ vars.ALLOW_AUTO_MERGE_REDIST_PR }}
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate redist update
run: |
echo "🔍 Verifying redist update..."
VARIANT=$(echo "${GITHUB_HEAD_REF}" | cut -d'/' -f2 | sed -E 's/-[0-9]{8}-[0-9]{6}$//')
echo "Detected variant: $VARIANT"
case "$VARIANT" in
client-preview) REDIST_DIR="redist/redist-client-preview" ;;
server-preview) REDIST_DIR="redist/redist-server-preview" ;;
client-preview-old) REDIST_DIR="redist/redist-client-preview-old" ;;
server-preview-old) REDIST_DIR="redist/redist-server-preview-old" ;;
client) REDIST_DIR="redist/redist-client" ;;
server) REDIST_DIR="redist/redist-server" ;;
*)
echo "Unknown variant: $VARIANT"
exit 1
;;
esac
echo "Checking directory: $REDIST_DIR"
if [[ ! -f "$REDIST_DIR/README.md" ]]; then
echo "Missing README.md file in $REDIST_DIR!"
exit 1
fi
- name: Auto-approve PR
if: success() && env.ALLOW_AUTO_MERGE_REDIST_PR != 'true' && github.actor == 'sunnamed434'
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-merge PR
if: success() && env.ALLOW_AUTO_MERGE_REDIST_PR == 'true' && github.actor == 'sunnamed434'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.PAT }}
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: squash