review-comments: add more descriptive comments to various persist/restoreState callsites.

Co-authored-by: Henry Mercer <henrymercer@github.com>
Co-authored-by: Fotis Koutoulakis <nlightnfotis@github.com>
This commit is contained in:
Fotis Koutoulakis (@NlightNFotis) 2024-10-21 15:42:51 +01:00
parent cdceebcb88
commit 9bc4ee10c7
24 changed files with 24 additions and 28 deletions

View file

@ -564,7 +564,7 @@ const persistedInputsKey = "persisted_inputs";
/**
* Persists all inputs to the action as state that can be retrieved later in the post-action.
* This is need due to a runner bug that can cause inputs to be lost in the post-action.
* This would be simplified if actions/runner#3514 is addressed.
* https://github.com/actions/runner/issues/3514
*/
export const persistInputs = function () {

View file

@ -199,7 +199,7 @@ async function run() {
let didUploadTrapCaches = false;
util.initializeEnvironment(actionsUtil.getActionVersion());
// Work around for issue in actions/runner, details at
// Make inputs accessible in the `post` step, details at
// https://github.com/github/codeql-action/issues/2553
actionsUtil.persistInputs();

View file

@ -46,8 +46,7 @@ async function runWrapper() {
| initActionPostHelper.UploadFailedSarifResult
| undefined;
try {
// Work around for issue in actions/runner, details at
// https://github.com/github/codeql-action/issues/2553
// Restore inputs from `init` Action.
restoreInputs();
const gitHubVersion = await getGitHubVersion();

View file

@ -251,8 +251,7 @@ async function run() {
const logger = getActionsLogger();
initializeEnvironment(getActionVersion());
// Work around for issue in actions/runner, details at
// https://github.com/github/codeql-action/issues/2553
// Make inputs accessible in the `post` step.
persistInputs();
let config: configUtils.Config | undefined;

View file

@ -20,8 +20,7 @@ import {
async function runWrapper() {
try {
// Work around for issue in actions/runner, details at
// https://github.com/github/codeql-action/issues/2553
// Restore inputs from `start-proxy` Action.
actionsUtil.restoreInputs();
const pid = core.getState("proxy-process-pid");
if (pid) {

View file

@ -91,8 +91,7 @@ function generateCertificateAuthority(): CertificateAuthority {
}
async function runWrapper() {
// Work around for issue in actions/runner, details at
// https://github.com/github/codeql-action/issues/2553
// Make inputs accessible in the `post` step.
actionsUtil.persistInputs();
const logger = getActionsLogger();

View file

@ -21,6 +21,7 @@ import {
async function runWrapper() {
try {
// Restore inputs from `upload-sarif` Action.
actionsUtil.restoreInputs();
const logger = getActionsLogger();
const gitHubVersion = await getGitHubVersion();

View file

@ -60,6 +60,7 @@ async function run() {
const gitHubVersion = await getGitHubVersion();
checkActionVersion(getActionVersion(), gitHubVersion);
// Make inputs accessible in the `post` step.
actionsUtil.persistInputs();
const repositoryNwo = parseRepositoryNwo(