This GitHub Action downloads the Fly CLI and configures package managers to use Fly as a registry for dependencies.
- ✅ Supports all package managers available in Fly CLI
- ✅ Configures all detected package managers with a single command
- ✅ OIDC authentication only
- ✅ Allows ignoring specific package managers
- ✅ Automatic CI session end notification to the Fly server
name: Build with Fly Registry
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Fly registry with OIDC
- name: Setup Fly Registry
uses: jfrog/fly-action@v1
with:
url: https://fly.example.com
# ignore: docker,pip (optional)This action only supports OIDC authentication for enhanced security. You must set permissions: id-token: write in your workflow file.
permissions:
id-token: write # Required for OIDC authenticationurl: Fly URL
ignore: Comma-separated list of package managers to ignore (e.g., docker,pip)
| Input | Description | Required | Default |
|---|---|---|---|
url |
Fly URL | Yes | N/A |
ignore |
Comma-separated list of package managers to ignore | No | None |
When using OIDC authentication:
- Your Fly server must support the OpenID Connect protocol and have a provider configured
- You need to set
permissions: id-token: writein your workflow file - The provider name is fixed to
fly-action - The action will:
- Request an OIDC token from GitHub Actions
- Exchange it for a Fly access token via the
/fly/api/v1/ci/start-oidcendpoint - Use the resulting token to authenticate with Fly
- Automatically notify CI session end via the
/fly/api/v1/ci/endendpoint when the job completes (using GitHub Actions post-job mechanism)
Note: The CI end notification runs automatically as a post-job step. This ensures it executes even if the main action fails, for proper session management on the Fly server. If the CI end notification step itself encounters an error, it will cause the overall workflow to be marked as failed.
To use OIDC authentication, your Fly server must be configured with:
- An OIDC provider that accepts GitHub Actions tokens
- Custom Fly API endpoints:
/fly/api/v1/ci/start-oidcfor token exchange and CI session initialization/fly/api/v1/ci/endfor CI session end notification
- Custom audience claim support (if using non-default audience)
The action supports all package managers that the Fly CLI supports:
- npm, pnpm, yarn – Node.js package managers (npm registry)
- pip, pipenv, poetry, twine – Python package managers (PyPI repository)
- nuget, dotnet – .NET package managers (NuGet)
- docker, podman – Container registries (Docker)
- helm – Kubernetes package manager
- go – Go modules
- gradle – Gradle build tool
- maven – Maven build tool
Integration tests run automatically on pushes to the main branch, but require a valid Fly test server to be configured. The integration test will only run if the FLY_TEST_URL repository variable is set.
To configure integration testing:
- Set up a Fly server that supports the required API endpoints
- Set the
FLY_TEST_URLrepository variable in your GitHub repository settings - The integration test will automatically run on the next push
The action is built using npm run build. This command formats the code with Prettier, performs type checking using TypeScript (tsc), and then compiles and bundles src/index.ts and src/post.ts into single executable JavaScript files: lib/index.js and lib/post.js. These lib/ files are what the GitHub Action executes.
A Husky pre-commit hook is configured to run npm run build automatically on each commit, ensuring that code is formatted, type-checked, and bundled before being committed.
To develop and test locally:
- Clone the repository.
- Install dependencies:
npm install(this also runs Prettier via thepostinstallhook). - Build:
npm run build(this formats, type-checks TypeScript withtsc, and bundles the TypeScript source files into JavaScript for the action usingncc). - Run tests:
npm test.
A Husky pre-commit hook is configured—any
git commitwill triggernpm run buildto ensure your code is formatted, compiled, and bundled before committing.
-
Ensure tests pass and build is up to date:
npm test && npm run build
-
Push changes to the default branch (e.g.,
main):git push origin main
-
Draft a release in the GitHub UI:
- Go to the “Releases” page of your repository.
- Click Draft a new release.
- Set the tag name to
vX.Y.Z(e.g.,v1.2.3). - Publish the release.
Once the release is published, the GitHub Actions workflow will:
- Extract the version from the tag (
vX.Y.Z). - Bump
package.jsonandpackage-lock.jsontoX.Y.Z. - Commit and push the updated lockfile.
- Update and force-push the
vX.YandvXtags. - Push all changes back to the repository.
This GitHub Action is licensed under the Apache-2.0.