- Task
- Version · 6.0.2
- Create
Authenticate with Snowflake workload identity federation from GitHub Actions
Last updated: November 17, 2026
Run Liquibase against Snowflake from a GitHub Actions workflow without storing a password, key pair, or access token anywhere. Snowflake workload identity federation (WIF) trusts the short-lived OpenID Connect (OIDC) token GitHub issues to each workflow run, so the only connection detail you keep in GitHub is the JDBC URL.
The Snowflake JDBC driver bundled with Liquibase performs the exchange, not Liquibase itself. Leave snowflake-auth-type unset: Liquibase passes the URL to the driver untouched, and the driver sends the token to Snowflake. Every Liquibase Secure release from 5.0 onward bundles a driver that supports WIF.
Before you begin
You must be able to run SQL in Snowflake as
ACCOUNTADMIN, or as a role that can create users and roles and grant privileges.Your workflow must run on a Linux or macOS runner with
bash,curl, andjqinstalled. On a Windows runner,run:steps default to PowerShell, so setshell: bashon each one.The runner must have outbound HTTPS access to your Snowflake account host,
your_org-your_account.snowflakecomputing.com. If your account has a network policy, allow the runner's egress IP addresses.
Procedure
Create the Snowflake objects and role Liquibase will use
Create the database, schema, warehouse, and role that Liquibase connects with. If these already exist, grant the role the privileges shown and move on.
Be sure to:
Replace
your_databasewith the database Liquibase will manage. For example,LB_WIF_TESTReplace
your_schemawith the schema inside it. For example,PUBLICReplace
your_warehousewith the warehouse Liquibase runs on. For example,LB_WIF_TEST_WHReplace
your_rolewith the role Liquibase connects as. For example,LB_WIF_TEST_ROLE
Add the workflow to your repository
Create .github/workflows/snowflake-connect.yml. The workflow requests an OIDC token from GitHub with the audience snowflakecomputing.com, appends it to the JDBC URL, and runs liquibase connect.
Three lines decide whether the token exchange works:
permissions: id-token: writelets GitHub issue the OIDC token. Without it, the token step returnsnull.actions/checkoutruns first, so the changelog is on disk before Liquibase reads it.LIQUIBASE_COMMAND_URLis set on the Liquibase step, after the token exists, not at the workflow level.
The token step also prints the token's iss, sub, and aud claims. None of them is secret, and you need the sub value in step 4.
If your runner is self-hosted, replace runs-on: ubuntu-latest with your runner label, and keep or drop the two setup steps depending on whether Java and Liquibase are already installed on it.
Create the GitHub environment, secret, and variable
In your repository, go to Settings, then Environments, and create an environment named DEV. The environment name becomes part of the token's subject, so each environment you add later can map to its own Snowflake service user with its own privileges.
Then add one secret and one variable. The variable holds the JDBC URL without a token, because the workflow fetches a fresh token on every run and appends it. No username or password is needed.
Name | Type | Where | Value |
| Secret | Repository or environment | Your Liquibase Secure license key |
| Variable | The | The JDBC URL below |
Be sure to:
Replace
your_org-your_accountwith your account identifier. RunSELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();in Snowflake to print it. For example,ABCDEFG-XY12345Replace
your_database,your_schema,your_warehouse, andyour_rolewith the names from step 1
Note: LIQUIBASE_URL must be a variable, not a secret. The workflow reads it as vars.LIQUIBASE_URL, and a secret of the same name is invisible there.
Run the workflow once to read the token's subject
Snowflake matches the token's sub claim against the service user's SUBJECT exactly, including case, so copy the real value rather than building it by hand.
Go to Actions, select Liquibase Secure Connect for Snowflake WIF, select Run workflow, choose the
DEVenvironment, and run it.The Liquibase step fails, because the Snowflake user does not exist yet. That is expected.
Open the Get GitHub OIDC token step and copy the
subvalue from its output:
The subject ends in :environment:DEV because the job references an environment. A job with no environment gets a branch-based subject instead, such as repo:your_owner/your_repo:ref:refs/heads/main. Repositories created after July 15, 2026 also carry GitHub's numeric owner and repository IDs in the subject, as the example shows.
Create the Snowflake service user with the OIDC workload identity
Create a service user whose workload identity names GitHub as the issuer and the subject you copied in step 4. OIDC_AUDIENCE_LIST matches the audience the workflow requested.
Be sure to:
Replace
your_userwith the name of the service user. For example,LB_WIF_TEST_USERReplace
your_roleandyour_warehousewith the names from step 1Replace
your_subjectwith thesubvalue from step 4, exactly as printed
Confirm the identity is active:
If the user already exists and the subject has changed, for example after you added a GitHub environment, replace the identity instead of creating the user:
Run the workflow again and verify the connection
Run the workflow as in step 4. This time the Liquibase connect step succeeds and reports the database's response.
To confirm the login on the Snowflake side, query the login history. ACCOUNT_USAGE views can lag by up to a couple of hours.
Be sure to replace your_user with the service user from step 5.
Once the connection works, change the last step's run: line from liquibase connect to liquibase update to deploy your changelog the same way.
Note: At higher log levels the full JDBC URL, including the token, can appear in Liquibase log output and in a log file such as logs/log.json. The token expires quickly, but do not upload log files as workflow artifacts without removing it.
Troubleshooting
Symptom | Likely cause | Fix |
|
| Create |
Snowflake rejects the login after the URL is correct | The token's | Copy the exact |
The token step prints |
| Add it at the workflow or job level |
The driver reports that a user is required | The driver wants a user name for your configuration | Append |
The driver does not recognize the | The bundled Snowflake JDBC driver is older than 3.26.0 | Confirm the version of |