Skip to content

Commit 949a1d9

Browse files
committed
feat(actions): update danger github action
1 parent 47f4199 commit 949a1d9

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

action.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
name: 'danger-kotlin'
22
description: 'Stop saying "you forgot to …" in code review'
3+
author: 'Konstantin Aksenov'
4+
branding:
5+
icon: 'check-square'
6+
color: 'green'
7+
inputs:
8+
dangerfile:
9+
description: 'Path to danger file'
10+
required: false
11+
default: 'Dangerfile.df.kts'
12+
run-mode:
13+
description: 'Run mode: ci, local, pr'
14+
required: false
15+
default: 'ci'
16+
job-id:
17+
description: 'Reported CI job ID'
18+
required: false
19+
default: 'danger/kotlin'
20+
args:
21+
description: 'Extra custom arguments like "--failOnErrors --no-publish-check" and etc'
22+
required: false
23+
324
runs:
425
using: 'docker'
5-
image: 'Dockerfile'
26+
image: 'github-action/Dockerfile'
27+
args:
28+
- ${{ inputs.dangerfile }}
29+
- ${{ inputs.run-mode }}
30+
- ${{ inputs.job-id }}
31+
- ${{ inputs.args }}

github-action/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ghcr.io/danger/danger-kotlin:1.3.0
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
5+
ENTRYPOINT ["/entrypoint.sh"]

github-action/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#! /bin/bash
2+
3+
set -e
4+
5+
dangerFile=$1
6+
runMode=$2
7+
jobId=$3
8+
args=$4
9+
10+
echo "Danger JS version:"
11+
danger --version
12+
echo "Danger Kotlin version:"
13+
danger-koltin --version
14+
15+
if [ -f "$dangerFile"]; then
16+
danger-kotlin $runMode --dangerfile="$dangerFile" --id="$jobId" $args
17+
exit 0
18+
else
19+
echo "Danger file $dangerFile does not exist."
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)