Search code examples
androidgithubgithub-actionspipelineappsweep

Apsweep integration with github


I'm trying to add AppSweep to my github pipeline just like in this video.

I did everything like the video, but my pipeline is breaking with this error message:

Run ./gradlew uploadToAppSweepRelease
/home/runner/work/_temp/5a09b1f4-7766-4bd5-bf78-35a3877dd2ba.sh: line 1: ./gradlew: Permission denied
Error: Process completed with exit code 126.

I try to change my github-action-appsweep.yml to do this:

name: AppSweep mobile application security testing
on: [pull_request_target]
jobs:
  upload-app-to-appsweep:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Change file ownership
        run: sudo chown $USER:$USER ./gradlew

      - name: Grant executable permission to gradlew file
        run: chmod +x ./gradlew

      - name: Upload app to AppSweep with Gradle
        env:
          APPSWEEP_API_KEY: ${{ secrets.APPSWEEP_API_KEY }}
        run: ./gradlew uploadToAppSweepRelease

And just because it appears my pipeline was running Upload app to AppSweep with Gradle before running those other commands, I tried to modified like this:

name: AppSweep mobile application security testing
on: [pull_request_target]
jobs:
  upload-app-to-appsweep:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Upload app to AppSweep with Gradle
        env:
          APPSWEEP_API_KEY: ${{ secrets.APPSWEEP_API_KEY }}
        run: sudo chown $USER:$USER ./gradlew && chmod +x ./gradlew && ./gradlew uploadToAppSweepRelease

A screenshot from the pipeline:

enter image description here

As you can see, I set the API_KEY on my github project:

enter image description here

And I also select my github project on the App Sweep project:

enter image description here


Solution

  • For some reason, setting up JDK 1.8 solved the problem:

     - name: Set up JDK 1.8
       uses: actions/setup-java@v1
       with:
          java-version: 1.8
    
     - name: Change wrapper permissions
       run: chmod +x ./gradlew