MCPcopy
hub / github.com/formatjs/formatjs / main

Function main

tools/release-please/run.ts:110–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108}
109
110async function main() {
111 console.log(`Running release-please version: ${VERSION}`)
112 registerFormatjsPlugin()
113
114 const [owner, repo] = requiredEnv('GITHUB_REPOSITORY').split('/')
115 const token = process.env.GH_RELEASE_TOKEN || process.env.GITHUB_TOKEN || ''
116 if (!token) {
117 throw new Error('GH_RELEASE_TOKEN or GITHUB_TOKEN is required')
118 }
119
120 const requestedTargetBranch = process.env.RELEASE_PLEASE_TARGET_BRANCH
121 const github = await GitHub.create({
122 owner,
123 repo,
124 token,
125 apiUrl: process.env.GITHUB_API_URL || DEFAULT_GITHUB_API_URL,
126 graphqlUrl: (
127 process.env.GITHUB_GRAPHQL_URL || DEFAULT_GITHUB_GRAPHQL_URL
128 ).replace(/\/graphql$/, ''),
129 defaultBranch: requestedTargetBranch,
130 })
131 const targetBranch = requestedTargetBranch || github.repository.defaultBranch
132
133 const releaseManifest = await loadManifest(github, targetBranch)
134 outputReleases(await releaseManifest.createReleases())
135
136 const pullRequestManifest = await loadManifest(github, targetBranch)
137 outputPullRequests(await pullRequestManifest.createPullRequests())
138}
139
140if (import.meta.filename === process.argv[1]) {
141 main().catch(error => {

Callers 1

run.tsFile · 0.70

Calls 6

registerFormatjsPluginFunction · 0.85
requiredEnvFunction · 0.85
loadManifestFunction · 0.85
outputReleasesFunction · 0.85
outputPullRequestsFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected