From 3d88ede6a9ee2acbbf2dd43d601cfc18300a7f4e Mon Sep 17 00:00:00 2001 From: neel-astro Date: Tue, 3 Sep 2024 20:40:55 +0530 Subject: [PATCH 1/2] Add support for submodule cloning during checkout --- README.md | 1 + action.yaml | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7888ef1..f50af38 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ The following table lists the configuration options for the Deploy to Astro acti | `checkout` | `true` | Whether to checkout the repo as the first step. Set this to false if you want to modify repo contents before invoking the action. Your custom checkout step needs to have `fetch-depth` of `0` and `ref` equal to `${{ github.event.after }}` so all the commits in the PR are checked out. Look at the checkout step that runs within this action for reference. | | `deploy-image` | `false` | If true image and DAGs will deploy for any action that deploys code. | | `build-secrets` | `` | Mimics docker build --secret flag. See https://docs.docker.com/build/building/secrets/ for more information. Example input 'id=mysecret,src=secrets.txt'. | +| `submodule` | `false` | Whether to checkout submodules when cloning the repository: `false` to disable (default), `true` to checkout submodules or `recursive` to recursively checkout submodules. Works only when `checkout` is set to `true`. | ## Outputs diff --git a/action.yaml b/action.yaml index 356caec..f7ab91d 100644 --- a/action.yaml +++ b/action.yaml @@ -2,8 +2,8 @@ name: "Deploy Apache Airflow DAGs to Astro" description: "Test your DAGs and deploy your Astro project to a Deployment on Astro, Astronomer's managed Airflow service." author: "Astronomer" branding: - icon: 'upload-cloud' - color: 'purple' + icon: "upload-cloud" + color: "purple" inputs: root-folder: required: false @@ -82,6 +82,10 @@ inputs: build-secrets: required: false description: "Mimics docker build --secret flag. See https://docs.docker.com/build/building/secrets/ for more information. Example input 'id=mysecret,src=secrets.txt'" + submodule: + required: false + default: false + description: "Whether to checkout submodules when cloning the repository: `false` to disable (default), `true` to checkout submodules or `recursive` to recursively checkout submodules. Works only when `checkout` is set to `true`." outputs: preview-id: description: "The ID of the created deployment preview. Only works when action=create-deployment-preview" @@ -94,9 +98,10 @@ runs: uses: actions/checkout@v4 if: inputs.checkout == 'true' with: - fetch-depth: 0 # Fetch all history + fetch-depth: 0 # Fetch all history ref: ${{ github.event.after }} clean: false + submodules: ${{ inputs.submodule }} - name: Install Astro CLI run: | curl -sSL https://install.astronomer.io | sudo bash -s ${{ inputs.cli-version }} From 69d64b29b70969cc7c8e57e735c421e4b7f60a07 Mon Sep 17 00:00:00 2001 From: neel-astro Date: Wed, 4 Sep 2024 15:25:06 +0530 Subject: [PATCH 2/2] code review changes: s/submodules/checkout-submodules --- README.md | 2 +- action.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f50af38..e840e71 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ The following table lists the configuration options for the Deploy to Astro acti | `checkout` | `true` | Whether to checkout the repo as the first step. Set this to false if you want to modify repo contents before invoking the action. Your custom checkout step needs to have `fetch-depth` of `0` and `ref` equal to `${{ github.event.after }}` so all the commits in the PR are checked out. Look at the checkout step that runs within this action for reference. | | `deploy-image` | `false` | If true image and DAGs will deploy for any action that deploys code. | | `build-secrets` | `` | Mimics docker build --secret flag. See https://docs.docker.com/build/building/secrets/ for more information. Example input 'id=mysecret,src=secrets.txt'. | -| `submodule` | `false` | Whether to checkout submodules when cloning the repository: `false` to disable (default), `true` to checkout submodules or `recursive` to recursively checkout submodules. Works only when `checkout` is set to `true`. | +| `checkout-submodules` | `false` | Whether to checkout submodules when cloning the repository: `false` to disable (default), `true` to checkout submodules or `recursive` to recursively checkout submodules. Works only when `checkout` is set to `true`. Works only when `checkout` is set to `true`. | ## Outputs diff --git a/action.yaml b/action.yaml index f7ab91d..9592f32 100644 --- a/action.yaml +++ b/action.yaml @@ -82,7 +82,7 @@ inputs: build-secrets: required: false description: "Mimics docker build --secret flag. See https://docs.docker.com/build/building/secrets/ for more information. Example input 'id=mysecret,src=secrets.txt'" - submodule: + checkout-submodules: required: false default: false description: "Whether to checkout submodules when cloning the repository: `false` to disable (default), `true` to checkout submodules or `recursive` to recursively checkout submodules. Works only when `checkout` is set to `true`." @@ -101,7 +101,7 @@ runs: fetch-depth: 0 # Fetch all history ref: ${{ github.event.after }} clean: false - submodules: ${{ inputs.submodule }} + submodules: ${{ inputs.checkout-submodules }} - name: Install Astro CLI run: | curl -sSL https://install.astronomer.io | sudo bash -s ${{ inputs.cli-version }}