2022-12-14 15:12:23 +00:00
|
|
|
name: Changed Files
|
|
|
|
description: Checks changes against target branch
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
java:
|
|
|
|
description: Changes to Java files
|
|
|
|
value: ${{ steps.changes.outputs.java }}
|
|
|
|
themes:
|
|
|
|
description: Changes to themes
|
|
|
|
value: ${{ steps.changes.outputs.themes }}
|
|
|
|
js-adapter:
|
|
|
|
description: Changes to JavaScript adapter
|
|
|
|
value: ${{ steps.changes.outputs.js-adapter }}
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- id: changes
|
|
|
|
name: Find changes
|
|
|
|
shell: bash
|
2022-12-16 14:31:46 +00:00
|
|
|
# language=bash
|
2022-12-14 15:12:23 +00:00
|
|
|
run: |
|
|
|
|
BASE_REF=${{ github.base_ref }}
|
2022-12-16 14:31:46 +00:00
|
|
|
|
2022-12-14 15:12:23 +00:00
|
|
|
changed () {
|
|
|
|
git diff --name-only origin/${{ github.base_ref }} | grep -E "$1" &>/dev/null && echo true || echo false
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$BASE_REF" != "" ]; then
|
|
|
|
echo "Checking changes against orgin/$BASE_REF"
|
|
|
|
git fetch origin
|
2022-12-16 14:31:46 +00:00
|
|
|
|
2022-12-14 15:12:23 +00:00
|
|
|
JAVA=`changed '^.*/.*.java$'`
|
|
|
|
THEMES=`changed '^themes/src/main/.*$'`
|
|
|
|
JS_ADAPTER=`changed '^adapters/oidc/js/.*$'`
|
|
|
|
else
|
|
|
|
echo "Not a pull request, marking everything as changed"
|
|
|
|
|
|
|
|
JAVA=true
|
|
|
|
THEMES=true
|
|
|
|
JS_ADAPTER=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Java changed: $JAVA"
|
|
|
|
echo "Themes changed: $THEMES"
|
|
|
|
echo "JS adapter changed: $JS_ADAPTER"
|
2022-12-16 14:31:46 +00:00
|
|
|
|
2022-12-14 15:12:23 +00:00
|
|
|
echo "java=$JAVA" >> $GITHUB_OUTPUT
|
|
|
|
echo "themes=$THEMES" >> $GITHUB_OUTPUT
|
|
|
|
echo "js-adapter=$JS_ADAPTER" >> $GITHUB_OUTPUT
|