diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml new file mode 100644 index 0000000..aadc718 --- /dev/null +++ b/.github/workflows/github-action.yml @@ -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 ./ +