@@ -45,7 +45,6 @@ const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
45
45
46
46
const GITHUB_REPOSITORY = process . env . GITHUB_REPOSITORY ;
47
47
const GITHUB_EVENT_PATH = process . env . GITHUB_EVENT_PATH ;
48
- const GITHUB_SHA = process . env . GITHUB_SHA ;
49
48
const GITHUB_ACTOR = process . env . GITHUB_ACTOR ;
50
49
51
50
// Error messages
@@ -201,6 +200,9 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
201
200
await exec ( `git config --global user.name "${ name } "` ) ;
202
201
await exec ( `git config --global user.email "${ email } "` ) ;
203
202
203
+ // Get current sha of repo to use in commit message
204
+ const sha = ( await exec ( `git rev-parse HEAD` ) ) . stdout . trim ( ) . substr ( 0 , 7 ) ;
205
+
204
206
// Environment to pass to children
205
207
const env = Object . assign ( { } , process . env , {
206
208
SSH_AUTH_SOCK
@@ -287,7 +289,6 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
287
289
// TODO: replace this copy with a node implementation
288
290
await exec ( `cp -r ${ folder } /* ./` , { env, cwd : REPO_TEMP } ) ;
289
291
await exec ( `git add -A .` , { env, cwd : REPO_TEMP } ) ;
290
- const sha = GITHUB_SHA ? GITHUB_SHA . substr ( 0 , 7 ) : 'unknown' ;
291
292
await exec ( `git commit --allow-empty -m "Update ${ config . branch } to output generated at ${ sha } "` , { env, cwd : REPO_TEMP } ) ;
292
293
console . log ( `##[info] Pushing` ) ;
293
294
const push = await exec ( `git push origin "${ config . branch } "` , { env, cwd : REPO_TEMP } ) ;
0 commit comments