Skip to content

Commit

Permalink
ci(detekt): define temp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-Ritter committed Jan 22, 2024
1 parent f2138c8 commit b004d08
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ env:
# Release tag associated with version of Detekt to be installed
# SARIF support (required for this workflow) was introduced in Detekt v1.15.0
DETEKT_RELEASE_TAG: "1.23.4"
DETEKT_FILE_NAME: "detekt-cli-${DETEKT_VERSION}-all.jar"
DETEKT_URL: "https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION}/${DETEKT_FILE_NAME}"
DETEKT_FILE_NAME: "detekt-cli-$DETEKT_VERSION-all.jar"
DETEKT_URL: "https://github.com/detekt/detekt/releases/download/v$DETEKT_VERSION/$DETEKT_FILE_NAME"
DETEKT_DIRECTORY: "${{ runner.temp }}/detekt/lib/"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -64,19 +65,18 @@ jobs:
# Sets up the detekt cli
- name: Setup Detekt
run: |
dest=$( mktemp -d )
curl --request GET \
--url ${DETEKT_URL} \
--url $DETEKT_URL \
--silent \
--location \
--output $dest/${DETEKT_FILE_NAME}
mv $dest/${DETEKT_FILE_NAME} $dest/detekt.jar
--output $DETEKT_DIRECTORY/$DETEKT_FILE_NAME
mv $DETEKT_DIRECTORY/$DETEKT_FILE_NAME $DETEKT_DIRECTORY/detekt.jar
# Performs static analysis using Detekt
- name: Run Detekt
continue-on-error: true
run: |
java -jar $dest/detekt.jar --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
java -jar $DETEKT_DIRECTORY/detekt.jar --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
# Modifies the SARIF output produced by Detekt so that absolute URIs are relative
# This is so we can easily map results onto their source files
Expand Down

0 comments on commit b004d08

Please sign in to comment.