@@ -77,15 +77,17 @@ Check the **Actions** tab to see your deployment tracked!
7777
7878| Input | Required | Default | Description |
7979| -------| ----------| ---------| -------------|
80- | ` api_url ` | ❌ | ` https://api.versioner.io ` | Versioner API endpoint (override for testing or self-hosted ) |
81- | ` api_key ` | ✅ | - | Versioner API key (store in GitHub Secrets) |
80+ | ` api_url ` | ❌ | ` https://api.versioner.io ` | Versioner API endpoint (can also use ` VERSIONER_API_URL ` env var ) |
81+ | ` api_key ` | ✅* | - | Versioner API key (can also use ` VERSIONER_API_KEY ` env var, store in GitHub Secrets) |
8282| ` product_name ` | ❌ | repo name | Name of the product/service (defaults to repository name) |
8383| ` version ` | ✅ | - | Version identifier (e.g., git SHA, semantic version, build number) |
8484| ` environment ` | ❌ | - | Target environment (required for deployment events, optional for build events) |
8585| ` event_type ` | ❌ | ` deployment ` | Event type: ` build ` or ` deployment ` |
8686| ` status ` | ❌ | ` success ` | Event status (` success ` , ` failure ` , ` in_progress ` ) |
8787| ` metadata ` | ❌ | ` {} ` | Additional JSON metadata to attach to the event |
88- | ` fail_on_rejection ` | ❌ | ` false ` | Fail the workflow if Versioner rejects the deployment (e.g., conflicts, no-deploy windows) |
88+ | ` fail_on_rejection ` | ❌ | ` true ` | Fail the workflow if Versioner rejects the deployment (e.g., conflicts, no-deploy windows) |
89+
90+ \* Required unless provided via ` VERSIONER_API_KEY ` environment variable
8991
9092## 📤 Outputs
9193
@@ -99,6 +101,53 @@ Check the **Actions** tab to see your deployment tracked!
99101
100102## 🔧 Usage Examples
101103
104+ ### Using Environment Variables (Recommended for Multiple Events)
105+
106+ Set ` VERSIONER_API_KEY ` once at the job or workflow level to avoid repeating it:
107+
108+ ``` yaml
109+ env :
110+ VERSIONER_API_KEY : ${{ secrets.VERSIONER_API_KEY }}
111+
112+ jobs :
113+ deploy :
114+ runs-on : ubuntu-latest
115+ steps :
116+ - name : Build start
117+ uses : versioner-io/versioner-github-action@v1
118+ with :
119+ version : ${{ github.sha }}
120+ event_type : build
121+ status : in_progress
122+
123+ - name : Build application
124+ run : npm run build
125+
126+ - name : Build complete
127+ uses : versioner-io/versioner-github-action@v1
128+ with :
129+ version : ${{ github.sha }}
130+ event_type : build
131+ status : success
132+
133+ - name : Deploy start
134+ uses : versioner-io/versioner-github-action@v1
135+ with :
136+ version : ${{ github.sha }}
137+ environment : production
138+ status : in_progress
139+
140+ - name : Deploy application
141+ run : ./deploy.sh production
142+
143+ - name : Deploy complete
144+ uses : versioner-io/versioner-github-action@v1
145+ with :
146+ version : ${{ github.sha }}
147+ environment : production
148+ status : success
149+ ` ` `
150+
102151### Track a Build (No Deployment)
103152
104153` ` ` yaml
@@ -107,8 +156,7 @@ Check the **Actions** tab to see your deployment tracked!
107156 with :
108157 api_key : ${{ secrets.VERSIONER_API_KEY }}
109158 version : ${{ github.sha }}
110- event_type : build
111- # No environment needed - just tracking the build!
159+ event_type : build # No environment needed - just tracking the build!
112160` ` `
113161
114162### Track a Deployment
0 commit comments