File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed
Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change 22
33set -e
44
5- git config --global --add safe.directory /github/workspace
6-
7- function reset_to_master() {
8- current_branch=" $( git rev-parse --abbrev-ref HEAD) "
9-
10- if [[ -n $( git status --porcelain) ]]; then
11- echo " Uncommitted changes present"
12- exit 1
13- fi
5+ DEFAULT_BRANCH=" master"
146
15- if [[ " $current_branch " == update-* ]]; then
16- echo " Resetting to master branch"
17- git checkout master
18- fi
19- }
7+ git config --global --add safe.directory /github/workspace
208
219# Args to pass to the data checker
2210args=(" --update" " --never-fork" )
@@ -51,11 +39,12 @@ for path in "${file_paths[@]}"; do
5139 # If we're not running in a container, use the Flatpak. Else, assume we're
5240 # running in a container and call the data checker directly.
5341 if [[ ! -f /run/.containerenv && ! -f /.dockerenv ]]; then
42+ git switch -fC " $DEFAULT_BRANCH " origin/" $DEFAULT_BRANCH "
5443 flatpak run --filesystem=" $( pwd) " org.flathub.flatpak-external-data-checker " ${args[@]} " " $path " || true
55- reset_to_master
44+ git switch -fC " $DEFAULT_BRANCH " origin/ " $DEFAULT_BRANCH "
5645 else
46+ git switch -fC " $DEFAULT_BRANCH " origin/" $DEFAULT_BRANCH "
5747 /app/flatpak-external-data-checker " ${args[@]} " " $path " || true
58- reset_to_master
48+ git switch -fC " $DEFAULT_BRANCH " origin/ " $DEFAULT_BRANCH "
5949 fi
6050done
61-
You can’t perform that action at this time.
0 commit comments