Skip to content

Commit ff5f1d1

Browse files
committed
Check for secrets.* before running jobs
1 parent d319c8f commit ff5f1d1

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

.github/workflows/release-staging.yml

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,83 @@ env:
4040
NODE_OPTIONS: "--max_old_space_size=4096"
4141

4242
jobs:
43+
has-secrets:
44+
name: Check for secrets
45+
runs-on: ubuntu-latest
46+
outputs:
47+
has-secrets: ${{ steps.check-secrets.outputs.has-secrets }}
48+
steps:
49+
- name: Check for secrets
50+
id: check-secrets
51+
env:
52+
HAS_SECRETS: ${{
53+
secrets.NPM_TOKEN_ANALYTICS != '' &&
54+
secrets.NPM_TOKEN_ANALYTICS_COMPAT != '' &&
55+
secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES != '' &&
56+
secrets.NPM_TOKEN_ANALYTICS_TYPES != '' &&
57+
secrets.NPM_TOKEN_API_DOCUMENTER != '' &&
58+
secrets.NPM_TOKEN_APP != '' &&
59+
secrets.NPM_TOKEN_APP_CHECK != '' &&
60+
secrets.NPM_TOKEN_APP_CHECK_COMPAT != '' &&
61+
secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES != '' &&
62+
secrets.NPM_TOKEN_APP_CHECK_TYPES != '' &&
63+
secrets.NPM_TOKEN_APP_COMPAT != '' &&
64+
secrets.NPM_TOKEN_APP_TYPES != '' &&
65+
secrets.NPM_TOKEN_AUTH != '' &&
66+
secrets.NPM_TOKEN_AUTH_COMPAT != '' &&
67+
secrets.NPM_TOKEN_AUTH_INTEROP_TYPES != '' &&
68+
secrets.NPM_TOKEN_AUTH_TYPES != '' &&
69+
secrets.NPM_TOKEN_COMPONENT != '' &&
70+
secrets.NPM_TOKEN_DATABASE != '' &&
71+
secrets.NPM_TOKEN_DATABASE_COMPAT != '' &&
72+
secrets.NPM_TOKEN_DATABASE_TYPES != '' &&
73+
secrets.NPM_TOKEN_FIREBASE != '' &&
74+
secrets.NPM_TOKEN_FIRESTORE != '' &&
75+
secrets.NPM_TOKEN_FIRESTORE_COMPAT != '' &&
76+
secrets.NPM_TOKEN_FIRESTORE_TYPES != '' &&
77+
secrets.NPM_TOKEN_FUNCTIONS != '' &&
78+
secrets.NPM_TOKEN_FUNCTIONS_COMPAT != '' &&
79+
secrets.NPM_TOKEN_FUNCTIONS_TYPES != '' &&
80+
secrets.NPM_TOKEN_INSTALLATIONS != '' &&
81+
secrets.NPM_TOKEN_INSTALLATIONS_COMPAT != '' &&
82+
secrets.NPM_TOKEN_INSTALLATIONS_TYPES != '' &&
83+
secrets.NPM_TOKEN_LOGGER != '' &&
84+
secrets.NPM_TOKEN_MESSAGING != '' &&
85+
secrets.NPM_TOKEN_MESSAGING_COMPAT != '' &&
86+
secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES != '' &&
87+
secrets.NPM_TOKEN_MESSAGING_TYPES != '' &&
88+
secrets.NPM_TOKEN_PERFORMANCE != '' &&
89+
secrets.NPM_TOKEN_PERFORMANCE_COMPAT != '' &&
90+
secrets.NPM_TOKEN_PERFORMANCE_TYPES != '' &&
91+
secrets.NPM_TOKEN_POLYFILL != '' &&
92+
secrets.NPM_TOKEN_REMOTE_CONFIG != '' &&
93+
secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT != '' &&
94+
secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES != '' &&
95+
secrets.NPM_TOKEN_RULES_UNIT_TESTING != '' &&
96+
secrets.NPM_TOKEN_STORAGE != '' &&
97+
secrets.NPM_TOKEN_STORAGE_COMPAT != '' &&
98+
secrets.NPM_TOKEN_STORAGE_TYPES != '' &&
99+
secrets.NPM_TOKEN_TESTING != '' &&
100+
secrets.NPM_TOKEN_UTIL != '' &&
101+
secrets.NPM_TOKEN_VERTEXAI != '' &&
102+
secrets.NPM_TOKEN_VERTEXAI_PREVIEW != '' &&
103+
secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER != '' &&
104+
secrets.OSS_BOT_GITHUB_TOKEN != '' &&
105+
secrets.OSS_BOT_GITHUB_TOKEN != '' &&
106+
secrets.RELEASE_TRACKER_URL != '' &&
107+
1 ||
108+
''
109+
}}
110+
if: env.HAS_SECRETS
111+
run: |
112+
echo "has-secrets=1" >> $GITHUB_OUTPUTS
113+
43114
deploy:
115+
needs: has-secrets
44116
name: Staging Release
45117
runs-on: ubuntu-latest
46118
# Block this workflow if run on a non-release branch.
47-
if: github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch')
119+
if: needs.has-secrets.outputs.has-secrets && (github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch'))
48120
steps:
49121
- name: Set up node (20)
50122
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)