Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/deployStack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('deployStack', () => {
.post('/stacks/create/standalone/string', {
name: 'new-stack-name',
stackFileContent:
"version: '3.7'\n\nservices:\n server1:\n image: ghcr.io/username/repo:1.2.3\n deploy:\n update_config:\n order: start-first\n server2:\n image: ghcr.io/username/repo:1.2.3\n deploy:\n update_config:\n order: start-first\n"
"version: '3.7'\n\nservices:\n server1:\n image: 'ghcr.io/username/repo:1.2.3'\n deploy:\n update_config:\n order: start-first\n server2:\n image: ghcr.io/username/repo:1.2.3\n deploy:\n update_config:\n order: start-first\n"
})
.query({
type: 2,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example-stack-definition-multi-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
server1:
image: ghcr.io/username/repo:latest
image: 'ghcr.io/username/repo:latest'
deploy:
update_config:
order: start-first
Expand Down
4 changes: 2 additions & 2 deletions src/deployStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function generateNewStackDefinition(
const imageWithoutTag = image.substring(0, image.indexOf(':'))
core.info(`Inserting image ${image} into the stack definition`)
const output = stackDefinition.replace(
new RegExp(`${imageWithoutTag}(:.*)?\n`, 'g'),
`${image}\n`
new RegExp(`${imageWithoutTag}:([^\\s'"]+)`, 'g'),
`${image}`
)
core.debug(`Updated stack definition:\n${output}`)
return output
Expand Down