-
Notifications
You must be signed in to change notification settings - Fork 0
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
Test Backend api #12
base: main
Are you sure you want to change the base?
Test Backend api #12
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -32,13 +32,23 @@ jobs: | |||||||||||||
with: | ||||||||||||||
version: 9 | ||||||||||||||
|
||||||||||||||
- name: Check for Terraform changes | ||||||||||||||
id: check_changes | ||||||||||||||
run: | | ||||||||||||||
if git diff --name-only -r HEAD^1 HEAD | grep -q '^terraform/.*\.tf$'; then | ||||||||||||||
echo "backend_api_hanges=true" >> $GITHUB_ENV | ||||||||||||||
else | ||||||||||||||
echo "backend_api_changes=false" >> $GITHUB_ENV | ||||||||||||||
fi | ||||||||||||||
|
||||||||||||||
- name: Install taskfile | ||||||||||||||
run: | | ||||||||||||||
sudo snap install task --classic | ||||||||||||||
|
||||||||||||||
- name: Terraform Plan | ||||||||||||||
run: task terraform-plan | ||||||||||||||
- name: Backend API Terraform Plan | ||||||||||||||
run: task backend-plan | ||||||||||||||
if: env.backend_api_changes == 'true' | ||||||||||||||
|
||||||||||||||
- name: Terraform Apply | ||||||||||||||
if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' | ||||||||||||||
- name: Backend Terraform Apply | ||||||||||||||
if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' && env.backend_api_changes == 'true' | ||||||||||||||
run: task terraform-apply | ||||||||||||||
Comment on lines
+56
to
58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix branch name condition The step has been correctly renamed and the additional condition for Apply this diff to fix the branch name condition: - if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' && env.backend_api_changes == 'true'
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push' && env.backend_api_changes == 'true' This change removes the extra double quotes around "main", which could cause the condition to fail. The rest of the changes in this step look good. The additional condition for 📝 Committable suggestion
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in environment variable name and improve script robustness
There's a typo in the environment variable name, and the script can be improved for better robustness:
backend_api_hanges
should bebackend_api_changes
.Apply this diff to fix the issues:
These changes will fix the typo and improve the script's robustness by preventing potential issues with word splitting and globbing.
📝 Committable suggestion
🧰 Tools
🪛 actionlint