Skip to content

Release 2.40.1

Release 2.40.1 #56

Workflow file for this run

name: Danger (Kotlin)
on:
pull_request:
types:
- opened
- edited
- synchronize
concurrency:
group: ${{ github.ref }}-danger-kotlin
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
danger-kotlin:
runs-on: ubuntu-latest
name: "Run Danger Kotlin"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 17
distribution: 'corretto'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
with:
validate-wrappers: false
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'yarn'
- name: Enable Corepack
run: corepack enable
- name: Cache Yarn dependencies
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: |
.yarn/cache
.yarn/unplugged
.yarn/install-state.gz
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install
- name: Debug Environment
run: |
echo "Java version:"
java -version
echo "Node version: $(node --version)"
echo "Yarn version: $(yarn --version)"
echo "Current directory: $(pwd)"
echo "Files in current directory:"
ls -la
echo "Checking for Dangerfile.df.kts:"
ls -la Dangerfile.df.kts || echo "Dangerfile.df.kts not found"
echo "Android directory contents:"
ls -la android/ || echo "android directory not found"
echo "Checking for gradlew:"
ls -la android/gradlew || echo "gradlew not found"
- name: Temporarily disable React plugin for detekt
run: |
# Comment out the React plugin line since detekt doesn't need it
sed -i.bak 's/^apply plugin: "com.facebook.react"/\/\/ apply plugin: "com.facebook.react"/' android/build.gradle
cat android/build.gradle | grep -A2 -B2 "facebook.react"
- name: Run detekt
run: |
echo "Running detekt with verbose output..."
cd android && ./gradlew detekt --stacktrace --continue || echo "Detekt completed with errors, running Danger..."
echo "Checking for detekt report:"
ls -la build/reports/detekt/ || echo "Detekt reports directory not found"
- name: Restore build.gradle
if: always()
run: |
# Restore the original build.gradle
mv android/build.gradle.bak android/build.gradle
- name: Run Danger Kotlin
run: |
docker run --rm \
-v $GITHUB_WORKSPACE:/github/workspace \
-v $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH \
-w /github/workspace \
-e GITHUB_ACTIONS=true \
-e GITHUB_WORKFLOW="${{ github.workflow }}" \
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-e GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH \
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
-e GITHUB_RUN_ID=$GITHUB_RUN_ID \
-e GITHUB_WORKSPACE=/github/workspace \
-e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \
-e GITHUB_SHA=$GITHUB_SHA \
-e GITHUB_REF=$GITHUB_REF \
-e GITHUB_ACTOR=$GITHUB_ACTOR \
-e GITHUB_API_URL=$GITHUB_API_URL \
-e GITHUB_HEAD_REF="${{ github.head_ref }}" \
-e GITHUB_BASE_REF="${{ github.base_ref }}" \
--entrypoint danger-kotlin \
ghcr.io/danger/danger-kotlin@sha256:a07b86ca87061d963ce08112aa058259c351020fb6d9925e086701a80fda8201 \
ci --id=kt --failOnErrors --no-publish-check --remove-previous-comments --verbose #1.3.3