feat: add gamemode selector in create world screen. always use creative with ?singleplayer=1
This commit is contained in:
parent
f4ef8f7d85
commit
0d8beef65c
11 changed files with 56 additions and 50 deletions
|
|
@ -6,10 +6,10 @@ const fns = {
|
|||
async getAlias () {
|
||||
const aliasesRaw = process.env.ALIASES
|
||||
if (!aliasesRaw) throw new Error('No aliases found')
|
||||
const aliases = aliasesRaw.split('\n').map((x) => x.split('='))
|
||||
const aliases = aliasesRaw.split('\n').map((x) => x.trim().split('='))
|
||||
const githubActionsPull = process.env.PULL_URL?.split('/').at(-1)
|
||||
if (!githubActionsPull) throw new Error(`Not a pull request, got ${process.env.GITHUB_REF}`)
|
||||
const prNumber = githubActionsPull[1]
|
||||
if (!githubActionsPull) throw new Error(`Not a pull request, got ${process.env.PULL_URL}`)
|
||||
const prNumber = githubActionsPull
|
||||
const alias = aliases.find((x) => x[0] === prNumber)
|
||||
if (alias) {
|
||||
// set github output
|
||||
|
|
@ -18,7 +18,7 @@ const fns = {
|
|||
}
|
||||
}
|
||||
|
||||
function setOutput(key, value) {
|
||||
function setOutput (key, value) {
|
||||
// Temporary hack until core actions library catches up with github new recommendations
|
||||
const output = process.env['GITHUB_OUTPUT']
|
||||
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue