Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hkusu committed Dec 20, 2023
1 parent 6935d61 commit 00a4dd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
with:
modules: |
app
app:debugRuntimeClasspath
configuration: |
releaseRuntimeClasspath
repository: 'android/sunflower'
head-ref: '8d000f6c72bc5384b4ca9f7452d620085919519d'
Expand All @@ -49,10 +52,3 @@ jobs:
echo '### outputs'
echo '- exists-diff: `${{ steps.report.outputs.exists-diff }}`'
} >> "$GITHUB_STEP_SUMMARY"
- name: Use this action
uses: ./
with:
modules: ' app app|debugRuntimeClasspath'
configuration: 'releaseRuntimeClasspath'
repository: 'android/sunflower'
head-ref: '8d000f6c72bc5384b4ca9f7452d620085919519d'
27 changes: 13 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,26 @@ runs:
if [ "$IS_VALID_EVENT" != 'true' ]; then raise_error "This action supports 'pull_request', 'pull_request_target' and 'merge_group' events."; fi
if [ -z "$MODULES" ]; then raise_error "Specify 'modules' input."; fi
modules="$(echo "$MODULES" | xargs)"
configuration="$(echo "$CONFIGURATION" | xargs)"
mods=()
confs=()
if [ -z "$modules" ]; then raise_error "Specify 'modules' input."; fi
if [[ "$configuration" =~ ' ' ]]; then raise_error "'configuration' input is not valid."; fi
set -o noglob
for mod in $MODULES ; do
conf="$CONFIGURATION"
echo "###${mod}####"
echo "###${conf}####"
for mod in $modules ; do
conf=''
if [[ "$mod" =~ '|' ]]; then
conf=${mod#*|}
mod=${mod%%|*}
conf="${mod#*|}"
mod="${mod%%|*}"
fi
if [ -z "$conf" ]; then conf="$configuration"; fi
if [[ -z "$mod" || -z "$conf" ]]; then raise_error "Incorrect 'modules' or 'configuration' input."; fi
if [ -z "$mod" ]; then raise_error "'modules' input is not valid."; fi
if [ -z "$conf" ]; then raise_error "Specify 'configuration' input."; fi
mods+=($mod)
confs+=($conf)
mods+=("$mod")
confs+=("$conf")
done
# get dependency-diff-tldr
Expand Down

0 comments on commit 00a4dd7

Please sign in to comment.