Skip to content

Commit fa725ea

Browse files
committed
Always use the sha as the ref
This is what other tools like Vercel previews appear to do
1 parent 3f34d47 commit fa725ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ async function post() {
193193
const github_token = core.getInput('github_token');
194194
const repository = process.env.GITHUB_REPOSITORY;
195195
const [owner, repo] = (repository || '').split('/');
196-
const ref = process.env.GITHUB_REF || process.env.GITHUB_SHA;
196+
const sha = process.env.GITHUB_SHA;
197197

198198
// Check if all required parameters are available for deployment
199-
if (github_token && owner && repo && ref && projectUuid && queryUrl) {
200-
core.info(`Creating deployment for ${owner}/${repo} at ${ref}`);
199+
if (github_token && owner && repo && sha && projectUuid && queryUrl) {
200+
core.info(`Creating deployment for ${owner}/${repo} at ${sha}`);
201201

202202
const octokit = require('@octokit/rest');
203203
const { Octokit } = octokit;
@@ -210,12 +210,12 @@ async function post() {
210210
const deployment = await client.repos.createDeployment({
211211
owner,
212212
repo,
213-
ref,
213+
sha,
214214
environment: 'polar-signals-cloud',
215215
required_contexts: [],
216216
auto_merge: false,
217217
description: 'Polar Signals Profiling Results',
218-
transient_environment: true,
218+
transient_environment: false,
219219
production_environment: false
220220
});
221221

0 commit comments

Comments
 (0)