Add language injection for larger bash scripts in composite actions (#16040)

This commit is contained in:
Stian Thorgersen 2022-12-16 15:31:46 +01:00 committed by GitHub
parent 2f02aa49dd
commit e1a8a30696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -18,9 +18,10 @@ runs:
- id: changes - id: changes
name: Find changes name: Find changes
shell: bash shell: bash
# language=bash
run: | run: |
BASE_REF=${{ github.base_ref }} BASE_REF=${{ github.base_ref }}
changed () { changed () {
git diff --name-only origin/${{ github.base_ref }} | grep -E "$1" &>/dev/null && echo true || echo false git diff --name-only origin/${{ github.base_ref }} | grep -E "$1" &>/dev/null && echo true || echo false
} }
@ -28,7 +29,7 @@ runs:
if [ "$BASE_REF" != "" ]; then if [ "$BASE_REF" != "" ]; then
echo "Checking changes against orgin/$BASE_REF" echo "Checking changes against orgin/$BASE_REF"
git fetch origin git fetch origin
JAVA=`changed '^.*/.*.java$'` JAVA=`changed '^.*/.*.java$'`
THEMES=`changed '^themes/src/main/.*$'` THEMES=`changed '^themes/src/main/.*$'`
JS_ADAPTER=`changed '^adapters/oidc/js/.*$'` JS_ADAPTER=`changed '^adapters/oidc/js/.*$'`
@ -43,7 +44,7 @@ runs:
echo "Java changed: $JAVA" echo "Java changed: $JAVA"
echo "Themes changed: $THEMES" echo "Themes changed: $THEMES"
echo "JS adapter changed: $JS_ADAPTER" echo "JS adapter changed: $JS_ADAPTER"
echo "java=$JAVA" >> $GITHUB_OUTPUT echo "java=$JAVA" >> $GITHUB_OUTPUT
echo "themes=$THEMES" >> $GITHUB_OUTPUT echo "themes=$THEMES" >> $GITHUB_OUTPUT
echo "js-adapter=$JS_ADAPTER" >> $GITHUB_OUTPUT echo "js-adapter=$JS_ADAPTER" >> $GITHUB_OUTPUT

View file

@ -8,6 +8,7 @@ runs:
name: Find flaky tests name: Find flaky tests
if: github.repository == 'keycloak/keycloak' if: github.repository == 'keycloak/keycloak'
shell: bash shell: bash
# language=bash
run: | run: |
REPO="${{ github.repository }}" REPO="${{ github.repository }}"
ISSUES_LINK="https://github.com/${{ github.repository }}/issues/" ISSUES_LINK="https://github.com/${{ github.repository }}/issues/"
@ -22,7 +23,7 @@ runs:
TITLE="Flaky test: $TEST" TITLE="Flaky test: $TEST"
BODY="$RUN"$'\n''```'$'\n'"$LOG"$'\n''```' BODY="$RUN"$'\n''```'$'\n'"$LOG"$'\n''```'
ISSUE="$(gh issue list --search "$TITLE in:title" --json number --jq .[].number)" ISSUE="$(gh issue list --search "$TITLE in:title" --json number --jq .[].number)"
if [ "$PR" == "" ]; then if [ "$PR" == "" ]; then
if [ "$ISSUE" == "" ]; then if [ "$ISSUE" == "" ]; then
LINK="$(gh issue create -t "$TITLE" -b "$BODY" -l "kind/bug,area/ci,flaky-test" | grep $ISSUES_LINK)" LINK="$(gh issue create -t "$TITLE" -b "$BODY" -l "kind/bug,area/ci,flaky-test" | grep $ISSUES_LINK)"