Compare commits

...

2 commits

4 changed files with 19 additions and 1 deletions

View file

@ -21,6 +21,10 @@ This is a fork of [wirgen/portainer-stack-redeploy-action](https://github.com/wi
ID of endpoint (environment). Required if your stack is not in local environment
### `repositoryAuthentication`
Use stored credentials to pull docker-compose.yaml from git repository. When credentials are stored, but this is not set to `true`, the action will fail
### `environment`
Environment variables to set on the stack. When omitted, all existing variables will be cleared from the stack. Must be input as a JSON String; one array of objects each with the keys `name` and `value`

View file

@ -16,12 +16,16 @@ inputs:
description: 'Endpoint ID'
required: false
default: ''
repositoryAuthentication:
description: 'Use stored credentials to pull docker-compose.yaml from git repository'
required: false
default: false
environment:
description: 'Environment variables'
required: false
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
branding:

5
dist/index.js vendored
View file

@ -2825,6 +2825,7 @@ let portainerUrl = core.getInput("portainerUrl")
const accessToken = core.getInput("accessToken")
const stackId = parseInt(core.getInput("stackId"))
const endpointId = parseInt(core.getInput("endpointId"))
const repositoryAuthentication = core.getInput("repositoryAuthentication")
const environmentVariables = core.getInput("environment")
if (isNaN(stackId)) {
@ -2855,6 +2856,10 @@ const postDataObject = {
pullImage: true,
}
if (repositoryAuthentication === true || repositoryAuthentication === 'true') {
postDataObject.repositoryAuthentication = true
}
if (environmentVariables !== undefined && environmentVariables !== "") {
postDataObject.env = JSON.parse(environmentVariables)
}

View file

@ -6,6 +6,7 @@ let portainerUrl = core.getInput("portainerUrl")
const accessToken = core.getInput("accessToken")
const stackId = parseInt(core.getInput("stackId"))
const endpointId = parseInt(core.getInput("endpointId"))
const repositoryAuthentication = core.getInput("repositoryAuthentication")
const environmentVariables = core.getInput("environment")
if (isNaN(stackId)) {
@ -36,6 +37,10 @@ const postDataObject = {
pullImage: true,
}
if (repositoryAuthentication === true || repositoryAuthentication === 'true') {
postDataObject.repositoryAuthentication = true
}
if (environmentVariables !== undefined && environmentVariables !== "") {
postDataObject.env = JSON.parse(environmentVariables)
}