create-platformatic 1.7.1 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/ghaction.mjs +10 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-platformatic",
3
- "version": "1.7.1",
3
+ "version": "1.8.1",
4
4
  "description": "Create platformatic-db interactive tool",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,7 +35,7 @@
35
35
  "strip-ansi": "^7.1.0",
36
36
  "undici": "^5.25.4",
37
37
  "which": "^3.0.1",
38
- "@platformatic/config": "1.7.1"
38
+ "@platformatic/config": "1.8.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "ajv": "^8.12.0",
@@ -48,8 +48,8 @@
48
48
  "tap": "^16.3.9",
49
49
  "typescript": "~5.2.2",
50
50
  "yaml": "^2.3.2",
51
- "@platformatic/db": "1.7.1",
52
- "@platformatic/service": "1.7.1"
51
+ "@platformatic/service": "1.8.1",
52
+ "@platformatic/db": "1.8.1"
53
53
  },
54
54
  "scripts": {
55
55
  "test:cli": "tap --no-coverage test/cli/*test.mjs -t120",
package/src/ghaction.mjs CHANGED
@@ -3,12 +3,12 @@ import { isFileAccessible, safeMkdir } from './utils.mjs'
3
3
  import { writeFile } from 'fs/promises'
4
4
  import columnify from 'columnify'
5
5
  function envAsString (env, indent) {
6
- const spaces = Array(indent * 2).join(' ')
6
+ const spaces = ' '.repeat(indent * 2)
7
7
  return Object.keys(env).reduce((acc, key) => {
8
8
  if (key.match('DATABASE_URL')) {
9
9
  acc += `${spaces}${key}: \${{ secrets.${key} }}\n`
10
10
  } else {
11
- acc += `${spaces}${key}: ${env[key]} \n`
11
+ acc += `${spaces}${key}: ${env[key]}\n`
12
12
  }
13
13
 
14
14
  return acc
@@ -32,7 +32,13 @@ function formatSecretsToAdd (secrets) {
32
32
  }
33
33
  export const dynamicWorkspaceGHTemplate = (env, config, buildTS = false) => {
34
34
  const envString = envAsString(env, 3)
35
-
35
+ let envBlock = ''
36
+ if (envString.length) {
37
+ envBlock = `
38
+ env:
39
+ ${envString}
40
+ `
41
+ }
36
42
  return `name: Deploy Platformatic application to the cloud
37
43
  on:
38
44
  pull_request:
@@ -52,8 +58,7 @@ jobs:
52
58
  contents: read
53
59
  pull-requests: write
54
60
  runs-on: ubuntu-latest
55
- env:
56
- ${envString}
61
+ ${envBlock}
57
62
  steps:
58
63
  - name: Checkout application project repository
59
64
  uses: actions/checkout@v3