Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/state-helper.ts
blob: 0f86a14fe651404e336742c0623e7ffaf5a394cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as core from '@actions/core'
import * as coreCommand from '@actions/core/lib/command'

/**
 * Indicates whether the POST action is running
 */
export const IsPost = !!process.env['STATE_isPost']

/**
 * The repository path for the POST action. The value is empty during the MAIN action.
 */
export const RepositoryPath =
  (process.env['STATE_repositoryPath'] as string) || ''

/**
 * Save the repository path so the POST action can retrieve the value.
 */
export function setRepositoryPath(repositoryPath: string) {
  coreCommand.issueCommand(
    'save-state',
    {name: 'repositoryPath'},
    repositoryPath
  )
}

// Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
// This is necessary since we don't have a separate entry point.
if (!IsPost) {
  coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true')
}