Skip to content

Commit

Permalink
fix(github-action-example): check for the key later based on the dete…
Browse files Browse the repository at this point in the history
…rmined stage (#2651)

## Describe your changes
Fix example github action for the secret name

## Issue ticket number and link

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is: 


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced deployment workflow to support dynamic secret key handling
based on deployment stages.
  
- **Bug Fixes**
- Improved error handling for missing secret keys, ensuring clearer
feedback during deployment processes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
khaliqgant authored Aug 29, 2024
1 parent cfa8a59 commit d35ed94
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions github-actions/nango-deploy.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check if NANGO_DEV_SECRET_KEY is set
run: |
if [ -z "${{ secrets.NANGO_DEV_SECRET_KEY }}" ]; then
echo "Error: NANGO_DEV_SECRET_KEY secret is not set"
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nango CLI
Expand All @@ -49,4 +43,14 @@ jobs:
else
stage="dev"
fi
STAGE_UPPER=$(echo "$stage" | tr '[:lower:]' '[:upper:]')
SECRET_KEY_VAR="NANGO_SECRET_KEY_${STAGE_UPPER}"
if [ -z "${!SECRET_KEY_VAR}" ]; then
echo "Error: ${SECRET_KEY_VAR} secret is not set"
exit 1
fi
nango deploy "$stage" --auto-confirm ${{ inputs.allowDestructive == 'true' && '--allow-destructive' || '' }}

0 comments on commit d35ed94

Please sign in to comment.