Skip to content

Commit

Permalink
code review changes: allow inputs for worflow_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro committed Sep 17, 2024
1 parent 4ab27ed commit d1e3610
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 52 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/e2e/get_astro_env_info/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Get Astro Environment Info
description: Get information about the Astro environment
inputs:
input_workspace_id:
description: The workspace ID via input
required: true
secret_workspace_id:
description: The workspace ID via secret
required: true
input_organization_id:
description: The organization ID via input
required: true
secret_organization_id:
description: The organization ID via secret
required: true
input_astro_api_token:
description: The Astronomer API token via input
required: true
secret_astro_api_token:
description: The Astronomer API token via secret
required: true
input_astronomer_host:
description: The Astronomer host via input
required: true
secret_astronomer_host:
description: The Astronomer host via secret
required: true

outputs:
organization_id:
value: ${{ steps.get-info.outputs.ORGANIZATION_ID }}
workspace_id:
value: ${{ steps.get-info.outputs.WORKSPACE_ID }}
astronomer_host:
value: ${{ steps.get-info.outputs.ASTRONOMER_HOST }}
astro_api_token:
value: ${{ steps.get-info.outputs.ASTRO_API_TOKEN }}

runs:
using: "composite"
steps:
- name: Get info from inputs or secrets
shell: bash
id: get-info
run: |
if [ "${{ inputs.input_workspace_id }}" != "" ]; then
echo "Using provided workspace_id"
echo "WORKSPACE_ID=${{ inputs.input_workspace_id }}" >> $GITHUB_OUTPUT
else
echo "WORKSPACE_ID=${{ inputs.secret_workspace_id }}" >> $GITHUB_OUTPUT
fi
if [ "${{ inputs.input_organization_id }}" != "" ]; then
echo "Using provided org_id"
echo "ORGANIZATION_ID=${{ inputs.input_organization_id }}" >> $GITHUB_OUTPUT
else
echo "ORGANIZATION_ID=${{ inputs.secret_organization_id }}" >> $GITHUB_OUTPUT
fi
if [ "${{ inputs.input_astronomer_host }}" != "" ]; then
echo "Using provided astronomer_host"
echo "ASTRONOMER_HOST=${{ inputs.input_astronomer_host }}" >> $GITHUB_OUTPUT
else
echo "ASTRONOMER_HOST=${{ inputs.secret_astronomer_host }}" >> $GITHUB_OUTPUT
fi
if [ "${{ inputs.input_astro_api_token }}" != "" ]; then
echo "Using provided token"
echo "ASTRO_API_TOKEN=${{ inputs.input_astro_api_token }}" >> $GITHUB_OUTPUT
echo "ASTRO_API_TOKEN=${{ inputs.input_astro_api_token }}" >> $GITHUB_ENV
else
echo "ASTRO_API_TOKEN=${{ inputs.secret_astro_api_token }}" >> $GITHUB_OUTPUT
echo "ASTRO_API_TOKEN=${{ inputs.secret_astro_api_token }}" >> $GITHUB_ENV
fi
2 changes: 1 addition & 1 deletion .github/workflows/e2e/validate_deployment/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate Deployment
name: Validate Deployment Deploy Versions
description: Validate deployment info from Astronomer API

inputs:
Expand Down
Loading

0 comments on commit d1e3610

Please sign in to comment.