-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (67 loc) · 2.14 KB
/
check-arm64.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
name: Verify ARM64 image availability
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
permissions:
contents: read
pull-requests: write
issues: write
jobs:
check-title:
runs-on: ubuntu-latest
outputs:
matched: ${{ steps.check_title.outputs.matched }}
steps:
- name: Check PR Title for Docker Image Update
id: check_title
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if echo "$PR_TITLE" | grep -E -q 'Update .* Docker (tag|digest)'; then
echo "matched=true" >> $GITHUB_OUTPUT
else
echo "matched=false" >> $GITHUB_OUTPUT
fi
check-arm64-image:
needs: check-title
if: needs.check-title.outputs.matched == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install requests
- name: Extract Image, Tag, and Digest from PR Diff
id: extract_image_tag_digest
env:
PR_NUMBER: ${{ github.event.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python .github/scripts/extract_image_info.py
- name: Run ARM64 Availability Check
id: arm64_check
run: |
python .github/scripts/check_arm64.py "${{ env.IMAGE }}" "${{ env.TAG }}" "${{ env.DIGEST }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: false
- name: Add `donotmerge` Label if Arm64 Not Available
if: failure()
run: |
gh pr edit ${{ github.event.number }} --add-label "donotmerge"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove `donotmerge` Label if Arm64 Available
if: success()
run: |
gh pr edit ${{ github.event.number }} --remove-label "donotmerge"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}