From f252d2b867858dcc82faf6b20ee27e160f3af765 Mon Sep 17 00:00:00 2001 From: Michael Babyn Date: Mon, 15 Sep 2025 15:09:39 -0400 Subject: [PATCH 1/4] add input so users can customize python version --- README.md | 1 + action.yml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 333ab13..7598e62 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ The inputs this action uses are: | `create_postgres` | `false` | None | True to create a Postgres instance for the app. | | `create_persistent_filesystem` | `false` | None | True to create a persistent filesystem for the app. | | `de_client_version` | `false` | None | Version of the Dash Enterprise client to install. If not provided, the latest version will be installed. | +| `python_version` | `false` | `3.10` | Python version to use for the deployment. If not provided, Python 3.10 will be used. | ### Preview deploy on pull request This action will deploy branches using the `on: pull_request: types: ['opened', 'edited', 'synchronize', 'closed']` trigger as `https://${DE_HOST}/${APP_NAME}-${event_number}`, e.g. if you are deploying an app called `inventory-analytics` to `example.plotly.host` and your PR number is `15`, the deploy preview would be available at `https://example.plotly.host/inventory-analytics-15` and would be redeployed on every new commit to that PR. diff --git a/action.yml b/action.yml index 129dbd5..5d20474 100644 --- a/action.yml +++ b/action.yml @@ -50,6 +50,11 @@ inputs: required: false default: '' type: string + python_version: + description: Python version to use for the deployment. If not provided, Python 3.10 will be used. + required: false + default: '3.10' + type: string @@ -60,7 +65,7 @@ runs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.10' + python-version: ${{ inputs.python_version }} - name: Install de-client shell: bash run: | From a018222dca6688e5f6795713b22a5e41bebfe6eb Mon Sep 17 00:00:00 2001 From: Celia <101562106+celia-lm@users.noreply.github.com> Date: Wed, 26 Nov 2025 14:26:28 +0100 Subject: [PATCH 2/4] Add Python version setting step Add step to set Python version in action.yml, for the temporary deployment environment (where we install de-client) and the deployed app --- action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/action.yml b/action.yml index 5d20474..dc9cec5 100644 --- a/action.yml +++ b/action.yml @@ -118,6 +118,15 @@ runs: -H "X-GitHub-Api-Version: 2022-11-28"\ https://api.github.com/repos/${{ github.repository }}/statuses/${{github.event.pull_request.head.sha || github.sha}}\ -d '{"state":"success","target_url":"https://${{ inputs.DE_HOST }}/apps/${{ steps.app_name.outputs.app_name }}","description":"App manager ready!","context":"deploy/${{ steps.app_name.outputs.app_name }}"}' + - name: Set Python version + shell: bash + if: ${{ inputs.python_version }} + run: | + de --no-keyfile apps update --app-name ${{ steps.app_name.outputs.app_name }} --python_version ${{ inputs.python_version }} + env: + DASH_ENTERPRISE_HOST: ${{inputs.DE_HOST}} + DASH_ENTERPRISE_PASSWORD: ${{inputs.DE_PASSWORD}} + DASH_ENTERPRISE_USERNAME: ${{inputs.DE_USERNAME}} - name: Create Redis shell: bash if: ${{ inputs.create_redis }} From 4abea99992f7f3bc1a04488e38bb7f33125d1d5d Mon Sep 17 00:00:00 2001 From: Celia <101562106+celia-lm@users.noreply.github.com> Date: Thu, 27 Nov 2025 17:33:08 +0100 Subject: [PATCH 3/4] Fix app update command in action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index dc9cec5..2f37acf 100644 --- a/action.yml +++ b/action.yml @@ -122,7 +122,7 @@ runs: shell: bash if: ${{ inputs.python_version }} run: | - de --no-keyfile apps update --app-name ${{ steps.app_name.outputs.app_name }} --python_version ${{ inputs.python_version }} + de --no-keyfile apps update --name ${{ steps.app_name.outputs.app_name }} --python_version ${{ inputs.python_version }} env: DASH_ENTERPRISE_HOST: ${{inputs.DE_HOST}} DASH_ENTERPRISE_PASSWORD: ${{inputs.DE_PASSWORD}} From 4c84570b7e9d00d668c6d43bfc78d999571dd6db Mon Sep 17 00:00:00 2001 From: Celia <101562106+celia-lm@users.noreply.github.com> Date: Thu, 27 Nov 2025 17:41:20 +0100 Subject: [PATCH 4/4] Fix typo in Python version parameter --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2f37acf..67875fe 100644 --- a/action.yml +++ b/action.yml @@ -122,7 +122,7 @@ runs: shell: bash if: ${{ inputs.python_version }} run: | - de --no-keyfile apps update --name ${{ steps.app_name.outputs.app_name }} --python_version ${{ inputs.python_version }} + de --no-keyfile apps update --name ${{ steps.app_name.outputs.app_name }} --python-version ${{ inputs.python_version }} env: DASH_ENTERPRISE_HOST: ${{inputs.DE_HOST}} DASH_ENTERPRISE_PASSWORD: ${{inputs.DE_PASSWORD}}