A CI workflow using XTP and Extism
To use xtp-ci from Github actions, add the following to your workflow:
- uses: dylibso/xtp-ci-demo@main
with:
action: checkRepo
token: ${{ secrets.XTP_TOKEN }}
appId: ${{ secrets.XTP_APP_ID }}
guestKey: myGuestKey
binding: my-binding-name
To use xtp-ci from Gitlab CI, add the following to your configuration file:
include:
- component: $CI_SERVER_FQDN/zshipko/xtp-ci@main
inputs:
token: $XTP_TOKEN
appId: $XTP_APP_ID
guestKey: myGuestKey
binding: my-binding-name
(in this example $XTP_TOKEN and $XTP_APP_ID are Gitlab CI variables)
Create a .env
file with the following environment variables:
XTP_TOKEN=""
XTP_GUEST_KEY=""
XTP_APP_ID=""
XTP_BINDING_NAME=""
Then you can run:
node dist/index.js {scanFiles|checkRepo}
There are two different operations that can be implemented in a plugin.
scanFiles
receivesRepoInfo
as input withinputFile
populated, it will be called once for each file. Returning an errorCheckResult
(whereresult.status = "error"
) will cause the action to fail.checkRepo
receivesRepoInfo
as input with noinputFile
and is called once for the entire repo. Like,scanFiles
returning an errorCheckResult
will cause the action to fail.