Skip to content

Commit 8e4151a

Browse files
committed
Use environment variables due to missing github.context.runAttempt
1 parent 86393ef commit 8e4151a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

post.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require('fs')
22
const path = require('path')
33
const cache = require('@actions/cache')
44
const core = require('@actions/core')
5-
const github = require('@actions/github')
65
const glob = require('@actions/glob')
76
const config = require('./config')
87
const gc = require('./gc')
@@ -81,7 +80,7 @@ async function saveDiskCache(cacheConfig) {
8180
// We don't want to follow symlinks as it's extremely slow on macOS.
8281
{ followSymbolicLinks: false }
8382
)
84-
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}-${github.context.runId}.${github.context.runAttempt}`
83+
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}-${process.env.GITHUB_RUN_ID}.${process.env.GITHUB_RUN_ATTEMPT}`
8584
core.debug(`Attempting to save ${paths} cache to ${key}`)
8685
await cache.saveCache(paths, key)
8786
core.info('Successfully saved cache')

0 commit comments

Comments
 (0)