GitHub
Sifflet brings its lineage into your GitHub pull requests. When a pull request changes dbt models, the dbt Impact Analysis GitHub Action asks Sifflet which tables and dashboards depend on these models, and posts the list as a pull request comment, so reviewers see the impact of a change before it reaches production.
Sifflet doesn't connect to GitHub and doesn't import anything from it: the action runs in your GitHub Actions workflows and calls the Sifflet API.
Permissions Required
The integration uses two tokens: a Sifflet access token, which the action uses to read lineage from Sifflet, and the GitHub token of the workflow, which the action uses to read the pull request and post the comment.
| Permission | Used for | Required |
|---|---|---|
Sifflet access token with the Viewer role | Get from Sifflet the assets downstream of each changed dbt model | Yes |
contents: read on the GITHUB_TOKEN of the workflow | Read the dbt_project.yml files of the repository to find the dbt project of each changed model | Yes |
pull-requests: write on the GITHUB_TOKEN of the workflow | List the files changed by the pull request, and post the impact report as a pull request comment | Yes |
pull-requests: write is the only write permission: the action uses it only to add a comment.
The action sends Sifflet the names of the changed dbt models and of their dbt projects, and the path of the pull request (<OWNER>/<REPOSITORY>/pull/<NUMBER>), which Sifflet records with each analyzed model. It doesn't send any code.
Requirements
Required Roles for Setup
- In GitHub, the right to edit workflows and to create Actions secrets in the repository (or in the organization, to share the secret between repositories).
- In Sifflet, the Admin role to create the access token. See Access Control.
Supported Versions and Editions
- Repositories hosted on GitHub.com. GitHub Enterprise Server isn't supported: the action always calls the GitHub.com API.
- Linux runners, since the action runs as a Docker container action. GitHub-hosted
ubuntu-*runners work.
Network Access
The connection goes from your GitHub Actions runners to Sifflet:
- The runner must reach your Sifflet API at
https://<TENANT>.siffletdata.com/api, and pull the action image from thepublic.ecr.awsregistry. - If your Sifflet instance restricts API access to known IP ranges, run the action on self-hosted runners whose IP addresses are allowed.
Other Prerequisites
- A dbt Core or dbt Cloud source in Sifflet for each dbt project of the repository. The
namein thedbt_project.ymlfile must match the dbt project name known to Sifflet. - Each dbt project of the repository has a
dbt_project.ymlfile in the directory of its models or in a parent directory.
Connect Sifflet to GitHub
Step 1: Create a Sifflet Access Token
- In Sifflet, go to Settings > Access Tokens and click New Access Token.
- Enter a name (for example
github-dbt-impact-analysis), select the Viewer role, and click Generate. - Copy the token. Sifflet shows it only once. It expires after 24 months by default: see Access Tokens to set another expiration and to rotate it.
- In GitHub, add the token as an Actions secret named
SIFFLET_API_TOKEN:- for one repository, go to Settings > Secrets and variables > Actions in the repository and click New repository secret (see Creating secrets for a repository);
- for several repositories, create it as an organization secret instead (see Creating secrets for an organization).
Step 2: Add the dbt Impact Analysis Action to Your Workflows
-
In your repository, create a workflow file, for example
.github/workflows/sifflet-dbt-impact-analysis.yml(see Creating your first workflow). You can also start from the GitHub Marketplace page of the action. -
Paste the following workflow. Replace
<TENANT>with the name of your Sifflet instance.on: [pull_request] permissions: contents: read pull-requests: write jobs: dbt_impact_analysis_job: runs-on: ubuntu-latest name: Impact analysis of dbt changes steps: - name: dbt impact analysis uses: siffletdata/dbt-impact-analysis-action@v1 with: git-provider-token: ${{ secrets.GITHUB_TOKEN }} sifflet-instance-url: https://<TENANT>.siffletdata.com sifflet-api-token: ${{ secrets.SIFFLET_API_TOKEN }} impacted-asset-types: 'DASHBOARD, DATASET' -
Adjust the inputs:
Input Required Description Example git-provider-tokenYes The GitHub token the action uses to read the pull request and comment on it. Keep ${{ secrets.GITHUB_TOKEN }}, with thepermissionsblock of the workflow above.${{ secrets.GITHUB_TOKEN }}sifflet-instance-urlYes The URL of your Sifflet instance, without /apiand without a trailing slashhttps://acme.siffletdata.comsifflet-api-tokenYes The Sifflet access token created in step 1 ${{ secrets.SIFFLET_API_TOKEN }}impacted-asset-typesNo The types of downstream assets to list in the report, separated by a comma and a space: DATASET,DASHBOARD. Empty (default): all of them.'DASHBOARD, DATASET'impacted-tagsNo Only list downstream assets that have at least one of these Sifflet tags, separated by a comma and a space. Empty (default): no tag filter. 'pii, finance' -
Commit the workflow file to your default branch.
The action now runs on every pull request. To check the setup, open a pull request that changes a dbt model: the action posts a Sifflet Impact Report comment. For what the report contains and how the action finds the changed models, see dbt Impact Analysis GitHub Action.
Troubleshooting
The Report Says a Model Is Not Found in Sifflet
- Symptom: the comment contains
<MODEL_NAME> not found in Sifflet. - Cause: Sifflet doesn't find exactly one dbt model with this name in a dbt project whose name matches the
nameof the closestdbt_project.ymlfile. Either the model doesn't exist in Sifflet yet (new model, or dbt source not refreshed since), or several dbt sources in Sifflet contain the same project and model. - Fix:
- Check that the
nameindbt_project.ymlmatches the project of your dbt source in Sifflet: see Other Prerequisites. - For a new model, run your dbt job and refresh the dbt source in Sifflet, then push a new commit to the pull request.
- If several dbt sources in Sifflet contain the same dbt project (for example one source per dbt target), the action can't choose between them and skips the model: see Limitations.
- Check that the
The Action Fails Without Posting a Comment
- Symptom: the job fails with
An error occurred: Invalid Github token for repository <OWNER>/<REPOSITORY>, or withError occurred when calling the Sifflet API for DBT model <MODEL_NAME>and status code401or403. - Cause: the GitHub token can't access the repository or lacks the permissions of the workflow, or the Sifflet access token is wrong, expired, or doesn't have the
Viewerrole. - Fix:
Updated 18 days ago

