diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70baef1..ca5b9d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,11 @@ jobs: - name: Build with Gradle uses: gradle/actions/setup-gradle@v3 env: - GITHUB_DEPLOY_USER: "${{ secrets.DEPLOY_USER }}" - GITHUB_DEPLOY_TOKEN: "${{ secrets.DEPLOY_TOKEN }}" + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} with: gradle-version: 8.0.2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bfcccaa..daf83b1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,8 +34,11 @@ jobs: gradle-version: 8.0.2 arguments: createRelease env: - GITHUB_DEPLOY_USER: ${{ secrets.DEPLOY_USER }} - GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} - name: Upload descriptor file artifact diff --git a/.gitignore b/.gitignore index a9e8fe5..f113d09 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,9 @@ hs_err_pid* /bin/ /.gradle/ +/libs/ +/dependences/ /build/ -*.properties \ No newline at end of file +*.properties +# skip folder dependencies +!dependencies/*.jar diff --git a/build.gradle b/build.gradle index 45b7e5f..8501a93 100644 --- a/build.gradle +++ b/build.gradle @@ -41,7 +41,7 @@ repositories { // Adempiere GitHub Organization url = 'https://maven.pkg.github.com/adempiere/adempiere' credentials { - // project property, system properrty, enviroment variable + // project property, system property, enviroment variable username = findProperty("deployUsername") ?: System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER") password = findProperty("deployToken") ?: System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN") } diff --git a/src/main/java/org/spin/processor/service/Service.java b/src/main/java/org/spin/processor/service/Service.java index 9d4f589..247e806 100644 --- a/src/main/java/org/spin/processor/service/Service.java +++ b/src/main/java/org/spin/processor/service/Service.java @@ -14,6 +14,8 @@ ************************************************************************************/ package org.spin.processor.service; +import java.util.Optional; + import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MProcess; import org.compiere.model.MRole; @@ -78,7 +80,7 @@ private static RunProcessorResponse.Builder runProcess(int processId, String par if(process == null || process.getAD_Process_ID() <= 0) { throw new AdempiereException("@AD_Process_ID@ @NotFound@"); } - if(!MRole.getDefault().getProcessAccess(process.getAD_Process_ID())) { + if(!Optional.ofNullable(MRole.getDefault().getProcessAccess(process.getAD_Process_ID())).orElse(false)) { if (process.isReport()) { throw new AdempiereException("@AccessCannotReport@"); }