Skip to content

Commit

Permalink
Create github-action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima2022 authored Nov 5, 2021
1 parent 9809d9b commit 27f5ba6
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/github-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# replace .war with .jar or .ear if needed
name: Whitesource Prioritize Java with Maven

on: workflow_dispatch

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean install -DskipTests=true
- name: WhiteSource Unified Agent Scan
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
WS_APIKEY: ${{secrets.APIKEY}}
WS_USERKEY: ${{secrets.USERKEY}}
WS_WSS_URL: https://saas.whitesourcesoftware.com/agent
WS_PRODUCTNAME: GH_${{github.event.repository.name}}
WS_PROJECTNAME: ${{github.ref}}_Prioritize
WS_ENABLEIMPACTANALYSIS: true
WS_REQUIREKNOWNSHA1: false
WS_RESOLVEALLDEPENDENCIES: false
WS_MAVEN_RESOLVEDEPENDENCIES: true
WS_MAVEN_AGGREGATEMODULES: true
WS_FILESYSTEMSCAN: false
WS_GENERATEPROJECTDETAILSJSON: true
run: |
curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
echo Unified Agent downloaded successfully
WARFILE=$(find ./ -type f -wholename "*/target/*.jar")
echo $WARFILE will be added to appPath
java -jar wss-unified-agent.jar -appPath $WARFILE -d ./

0 comments on commit 27f5ba6

Please sign in to comment.