Gitea Actions Integration
Introduction
Xygeni provides a xygeni-action
for downloading and running the scanner on the repository.
Usage
The xygeni-action
action downloads, configures and executes the Xygeni Scanner on the repository where the action is invoked.
Setting API token as encrypted secret in Gitea
The scanner needs an API token to communicate with the Xygeni platform. Such API token is a secret that could be registered safely at the appropriate scope (organization, repository or environment)

For example, to register the API token as a secret named XYGENI_TOKEN
, for repository in the current working directory.
Add a step calling the action
In a Gitea workflow (.gitea/workflows/*.yml
) the Xygeni scanner could be run on the repository files, typically after actions/checkout
to retrieve the branch sources.
You can configure a simple Gitea action with this workflow:
name: Xygeni Scan
on:
workflow_dispatch:
jobs:
xygeni-scan:
name: Xygeni Scan
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
repository: {ORG}/{REPO}
token: ${{ secrets.GITEA_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Xygeni-Scanner
uses: xygeni/[email protected]
with:
xygeni_url: https://api.xygeni.io/
token: ${{ secrets.XYGENI_TOKEN }}
gh_token: ${{ secrets.GITEA_TOKEN }}
Where XYGENI_TOKEN
is the name of the encrypted secret where the API token was saved. By default this action runs manually on: workflow_dispatch.

Parameters
The available parameters for the action are:
gitea_token
Gitea token to retrieve repository information for misconfigurations and compliance.
No
${GITEA_TOKEN}
directory
Directory to analyze
No
${{ github.workspace }}
token
API token
No
username
Xygeni account’s username. Not recommended, use token instead.
No
password
Xygeni account’s password. Not recommended, use token instead.
No
command
Command to execute by the scanner
No
scan --never-fail -n ${{ github.repository }} -d /app
Example for scanning only hard-coded secrets and IaC flaws detectors, and failing the build only when critical issues are found:
- name: Xygeni-Scanner
uses: xygeni/[email protected]
id: Xygeni-Scanner
with:
token: ${{ secrets.XYGENI_TOKEN }}
command: >-
scan -n ${{ gitea.repository }} -d ${{ gitea.repository }}
--run=secrets,iac --fail-on=critical
Last updated