Skip to main content
All CollectionsIntegrations & Automation
Integrating AppSweep with Github Projects
Integrating AppSweep with Github Projects
Updated yesterday

This guide explains how to integrate AppSweep with Github to automatically trigger the scans for potential security issues from within your Continuous Integration pipeline.

Prerequisites

Make sure you have set up the AppSweep Gradle plugin and created an API key for your application.

Note: The AppSweep Gradle plugin is only compatible with Gradle versions below 8.7.

GitHub action workflow configuration

The following action will trigger the AppSweep scan on each pull request to the branch with the workflow.

.github/workflows/github-action-appsweep.yml

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: $
run: ./gradlew uploadToAppSweepRelease

To not store the API key directly in your code, you should set a GitHub secret APPSWEEP_API_KEYwhich will be picked up by the Gradle plugin.

Note: The presented GitHub action is using the pull_request_target event which will be triggered by new pull requests to the branch. The pull_request_target event allows for GitHub secret access, where the API key can be stored securely.

Install the AppSweep App on your GitHub account

Installing AppSweep on your GitHub account allows AppSweep to report the results back to GitHub, and attach them to the pull request.

After clicking the link, you will be redirected to the installation process inside GitHub. If you belong to any organization, you will be asked if you would like to install AppSweep on your personal account or for organization use.

You will be asked to choose which GitHub repositories you would like to use AppSweep for. This permission allows AppSweep to access the chosen repositories.

After that just press the Install button.

AppSweep-GH inatallation

On the GitHub integration page inside AppSweep, you can then verify the successful installation of the GitHub app. You should see a green checkmark next to your GitHub login:

Screenshot from 2021-11-08 15-23-48

Now you can choose a repository to link with AppSweep. This list contains the set of all previously selected repositories.

Screenshot from 2021-11-05 13-12-21

After selecting the repository a green checkmark will be visible next to its name, indicating that the GitHub App was successfully installed for this repository.

scan_completed

Screenshot from 2021-11-05 13-09-26

The integration with Github is complete. AppSweep is now able to post scan results back to GitHub.
โ€‹

Viewing AppSweep scan results in GitHub

After configuring the AppSweep Gradle plugin, the GitHub action workflow, and the GitHub App, the results of a scan are posted directly to your GitHub repository.

When creating a pull request, the action will schedule a scan of your application. Typically after a few minutes, the scan will be finished and the results of the scan will be visible in the pull request.

Immediately after the action triggers the Gradle task, you will see notifications that the checks are running.

scan_in_progress

In the Checks section you will find a summary of the detected issues.

Screenshot from 2021-11-05 14-02-29-1

To see the detailed findings for your scan, you can go directly to AppSweep by clicking View more details on AppSweep.

Note: The AppSweep GitHub App uses the commit hash to identify which commit the results should be attached to. Therefore, it is required to push this commit to GitHub before the analysis is finished. If the commit is not pushed yet, the results can still be viewed inside AppSweep.

Did this answer your question?