forked from doctrine/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 75
40 lines (33 loc) · 1.06 KB
/
archive-validation.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
name: Git Archive Content Check
on:
pull_request:
branches:
- master
paths:
- .github/workflows/archive-validation.yml
- .ci/github/arhcive_allow.txt
- ./*
push:
branches:
- master
paths:
- .github/workflows/archive-validation.yml
- .ci/github/arhcive_allow.txt
- ./*
jobs:
archive-validation:
name: Git Archive Content Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: number-of-new-files
run: |
bash .ci/github/files_between_commits.sh $GITHUB_REF $GITHUB_SHA
number_of_new_files=$(for file in $(bash .ci/github/files_between_commits.sh $GITHUB_REF $GITHUB_SHA)
do
dirname $file;
done | sort | uniq | grep '^\.$' | wc -l)
echo "number_of_new_files=$number_of_new_files" >> $GITHUB_OUTPUT
- run: |
git archive -o archive.tar $GITHUB_SHA && sh .ci/github/validate_archive.sh archive.tar
if: ${{ steps.number-of-new-files.outputs.number_of_new_files > 0 }}