()
| 108 | } |
| 109 | |
| 110 | async 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 | |
| 140 | if (import.meta.filename === process.argv[1]) { |
| 141 | main().catch(error => { |
no test coverage detected