Skip to content

Commit 60f1bcb

Browse files
authored
build: Add PR check workflow (podman-desktop#10)
* build: Add PR check workflow Signed-off-by: Jeff MAURY <[email protected]>
1 parent 7a05b77 commit 60f1bcb

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/pr-check.yaml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#
2+
# Copyright (C) 2023 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: pr-check
19+
20+
on:
21+
pull_request:
22+
branches:
23+
- gh-pages
24+
25+
jobs:
26+
verify:
27+
name: Verify
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Verify images
33+
run: |
34+
if [ -f api/extensions.json ]; then
35+
for i in `jq -r .extensions[].versions[].ociUri api/extensions.json`
36+
do
37+
echo "Verify image $i"
38+
podman pull -q $i
39+
done
40+
else
41+
echo "api/extensions.json removed, forbidden"
42+
exit 1
43+
fi
44+
45+
- name: Verify files
46+
run: |
47+
if [ -f api/extensions.json ]; then
48+
for u in `jq -r .extensions[].versions[].files[].data api/extensions.json`
49+
do
50+
if [[ "$u" =~ ^"https://registry.podman-desktop.io" ]]; then
51+
f=${u:35}
52+
if [ ! -f "$f" ]; then
53+
echo "$f does not exist."
54+
exit 1
55+
fi
56+
else
57+
echo "Verify URL $u"
58+
curl -f -s -o /dev/null $u
59+
fi
60+
done
61+
else
62+
echo "api/extensions.json removed, forbidden"
63+
exit 1
64+
fi

0 commit comments

Comments
 (0)