Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for submodule cloning during checkout #77

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about checkout-submodules so its more clearly about the checkout and that you could have multiple?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to checkout-submodule, also ran through some manual tests to ensure it's functioning as per expectation

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"
Expand All @@ -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 }}
Expand Down