Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Skip acceptance tests for files in .ci-ignore
- Loading branch information
Showing
4 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
README.md | ||
CONTRIBUTING.md | ||
LICENSE.md | ||
ci/README.md | ||
ci/release_notes_template.md | ||
ci/release_notes.md | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
function skip_ci() { | ||
local ignore_list="$1" | ||
local changed_files="$2" | ||
while read -r changed_file | ||
do | ||
while read -r skip_for | ||
do | ||
# If a directory is on the allow-list | ||
if [ -d "$skip_for" ]; then | ||
for file_in_dir in "$skip_for"/*; do | ||
if [ "$file_in_dir" == "$changed_file" ]; then | ||
continue 3 | ||
fi | ||
done | ||
fi | ||
if [ "$skip_for" == "$changed_file" ] ; then | ||
continue 2 | ||
fi | ||
done < "$ignore_list" | ||
# If we get here the file is not skipped or in a skipped dir. | ||
return 1 | ||
done < "$changed_files" | ||
# If we get here, all files are skipped or in skipped dirs. | ||
return 0 | ||
} |