-
Notifications
You must be signed in to change notification settings - Fork 1
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
🎨 download yq if necessary #38
Conversation
README.md
Outdated
- uses: actions/checkout@v3 | ||
with: | ||
repository: Staffbase/gitops-github-action | ||
ref: v3 | ||
# It's important that you clone the repository into the .github/gitops path, because the GitHub Action has a hard dependency on this path. | ||
path: .github/gitops |
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.
Checkout of the complete repo is not necessary anymore.
action.yml
Outdated
@@ -138,6 +138,7 @@ runs: | |||
cache-to: type=gha,mode=max | |||
|
|||
- name: Update Docker Image in Repository | |||
if: inputs.gitopsenabled == 'true' |
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.
Moved check if gitops is enabled - same implementation as for docker.
action.yml
Outdated
# download and install yq | ||
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 | ||
sudo chmod +x /usr/local/bin/yq |
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.
That is the important change, so the binary is downloaded and installed.
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.
Why not using this? https://github.com/marketplace/actions/yq-portable-yaml-processor
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.
I would do that in the issue #40. I didn't want to make all the changes in one PR, otherwise it would be too confusing and the migration from version 3 to 4 still needs to be done. I would do that after the PR is merged.
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.
I created another pr #41 for it.
@@ -149,51 +150,53 @@ runs: | |||
fi | |||
} | |||
|
|||
if [[ ${{ inputs.gitopsenabled }} == "true" ]]; then |
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.
There I moved the check - further lines are only formatting stuff.
action.yml
Outdated
echo "Run update for STAGE" | ||
while IFS= read -r line; do | ||
echo "Check if path $line exists and get old current version" | ||
yq r -e $line |
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.
Using the installed binary. 🎉
action.yml
Outdated
# download and install yq | ||
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 | ||
sudo chmod +x /usr/local/bin/yq |
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.
Why not using this? https://github.com/marketplace/actions/yq-portable-yaml-processor
Type of Change
Description
Checklist