-
Notifications
You must be signed in to change notification settings - Fork 51
56 lines (47 loc) · 1.53 KB
/
generate-dockerfiles-patches.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
name: Generate Dockerfiles/patches
on:
push:
branches:
- master
tags-ignore:
- '*'
pull_request:
paths:
- cpanfile
- config.yml
- generate.pl
- .github/workflows/generate-dockerfiles-patches.yml
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up git user name and email
run: |
git config --global user.email "test@github-actions"
git config --global user.name "GitHub Actions"
- name: Install system perl and cpanm
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends perl cpanminus
- name: Install dependencies
run: |
sudo cpanm --quiet --installdeps --notest .
- name: Generate Dockerfiles/patches
id: generate
run: |
export DOCKER_PERL_DOWNLOADS_DIR=/tmp/docker-perl-downloads
perl ./generate.pl
/usr/bin/git --no-pager diff --stat > diffstat.txt
if [[ -s diffstat.txt ]]; then
echo has_extra_diffs=1 >> $GITHUB_OUTPUT
fi
- name: Fail if there are extra diffs
if: steps.generate.outputs.has_extra_diffs
run: |
echo "::error title=generate::Extra diffs found during generate"
echo "Additional changes found during generate - check diffstat below:"
echo "::group::diffstat"
cat diffstat.txt
echo "::endgroup::"
echo
exit 1