2020-09-02 10:07:11 +02:00
|
|
|
import * as core from '@actions/core';
|
|
|
|
|
2024-05-02 13:49:01 +02:00
|
|
|
import {Inputs, sanitizeInputs} from './context';
|
|
|
|
|
2020-09-02 10:07:11 +02:00
|
|
|
export const tmpDir = process.env['STATE_tmpDir'] || '';
|
2024-05-02 13:49:01 +02:00
|
|
|
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined;
|
2024-05-02 13:49:01 +02:00
|
|
|
export const buildRef = process.env['STATE_buildRef'] || '';
|
2024-06-27 11:26:35 +02:00
|
|
|
export const isSummarySupported = !!process.env['STATE_isSummarySupported'];
|
2020-09-02 10:07:11 +02:00
|
|
|
|
|
|
|
export function setTmpDir(tmpDir: string) {
|
|
|
|
core.saveState('tmpDir', tmpDir);
|
|
|
|
}
|
2024-05-02 13:49:01 +02:00
|
|
|
|
2024-05-02 13:49:01 +02:00
|
|
|
export function setInputs(inputs: Inputs) {
|
|
|
|
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs)));
|
|
|
|
}
|
|
|
|
|
2024-05-02 13:49:01 +02:00
|
|
|
export function setBuildRef(buildRef: string) {
|
|
|
|
core.saveState('buildRef', buildRef);
|
|
|
|
}
|
2024-06-27 11:26:35 +02:00
|
|
|
|
|
|
|
export function setSummarySupported() {
|
|
|
|
core.saveState('isSummarySupported', 'true');
|
|
|
|
}
|