Skip to content

Commit 9715fe7

Browse files
authored
Merge pull request #86 from tinybirdco/support-env
Support env
2 parents c544bc9 + a0c776d commit 9715fe7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/cd.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
required: false
1414
type: number
1515
default: 300
16+
tb_env:
17+
description: "a global environment variable to replace inside the jobs and run conditional workflows (e.g. staging/production deployments)"
18+
required: false
19+
type: string
1620
secrets:
1721
tb_admin_token:
1822
required: true
@@ -50,6 +54,7 @@ jobs:
5054
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
5155
echo "_ENV_FLAGS=$_ENV_FLAGS" >> $GITHUB_ENV
5256
echo "_NORMALIZED_BRANCH_NAME=$_NORMALIZED_BRANCH_NAME" >> $GITHUB_ENV
57+
echo "TB_ENV=${{ inputs.tb_env }}" >> $GITHUB_ENV
5358
grep -v '^#' .tinyenv >> $GITHUB_ENV
5459
echo >> $GITHUB_ENV # Ensures new line at the end of the file
5560

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ on:
2424
required: false
2525
type: boolean
2626
default: true
27+
tb_env:
28+
description: "a global environment variable to replace inside the jobs and run conditional workflows (e.g. staging/production deployments)"
29+
required: false
30+
type: string
2731
secrets:
2832
tb_admin_token:
2933
required: true
@@ -94,6 +98,7 @@ jobs:
9498
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
9599
echo "_ENV_FLAGS=$_ENV_FLAGS" >> $GITHUB_ENV
96100
echo "_NORMALIZED_BRANCH_NAME=$_NORMALIZED_BRANCH_NAME" >> $GITHUB_ENV
101+
echo "TB_ENV=${{ inputs.tb_env }}" >> $GITHUB_ENV
97102
grep -v '^#' .tinyenv >> $GITHUB_ENV
98103
echo >> $GITHUB_ENV # Ensures new line at the end of the file
99104

0 commit comments

Comments
 (0)