cache class for tool caching with gha

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2024-02-04 18:08:18 +01:00
parent 26949f5f39
commit 0a1d2c2307
4 changed files with 121 additions and 76 deletions

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
import crypto from 'crypto';
import fs from 'fs';
import * as core from '@actions/core';
import * as io from '@actions/io';
@@ -139,4 +140,8 @@ export class Util {
public static sleep(seconds: number) {
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
}
public static hash(input: string): string {
return crypto.createHash('sha256').update(input).digest('hex');
}
}