-
Notifications
You must be signed in to change notification settings - Fork 9
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
support GitHub Action #20
Conversation
if [ "${VERSION}" = "latest" ]; then | ||
DOWNLOAD_URL=$(curl "${api_request_args[@]}" https://api.github.com/repos/reproio/terraform-j2md/releases | jq -r '[.[] | select(.prerelease==false)][0].assets[].browser_download_url | select(match("Linux_x86_64"))') | ||
else | ||
DOWNLOAD_URL=https://github.com/reproio/terraform-j2md/releases/download/${VERSION}/terraform-j2md_Linux_x86_64.tar.gz | ||
fi |
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.
How about calculating archive name from combo of RUNNER_OS
and RUNNER_ARCH
?
https://docs.github.com/en/enterprise-cloud@latest/actions/learn-github-actions/variables
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 think this action used by OS and ARCH except Linux and x86_64 is a rare case. If anyone wants to support other OS or Arch, I'll improve at time.
action.yml
Outdated
mkdir -p ${RUNNER_TOOL_CACHE}/terraform-j2md | ||
cd /tmp | ||
curl -sfLO ${DOWNLOAD_URL} | ||
tar xzvf $(basename $DOWNLOAD_URL .tar.gz).tar.gz |
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.
[IMO] curl -sfL ${DOWNLOAD_URL} | tar xvf -
みたいにすると標準入力から受け取れるのでファイル名指定しなくて良くなると思います
README.md
Outdated
```yaml | ||
- uses: reproio/terraform-j2md@main | ||
with: | ||
version: v0.0.5 # or latest |
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.
[nits] 現状の最新v0.0.7
の方が良いんじゃないかと思いました。
action.yml
Outdated
cd /tmp | ||
curl -sfLO ${DOWNLOAD_URL} | ||
tar xzvf $(basename $DOWNLOAD_URL .tar.gz).tar.gz | ||
sudo install terraform-j2md ${RUNNER_TOOL_CACHE}/terraform-j2md/terraform-j2md |
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.
[IMO] installコマンド使っているなら
mkdir -p ${RUNNER_TOOL_CACHE}/terraform-j2md
を消して
sudo install -D terraform-j2md ${RUNNER_TOOL_CACHE}/terraform-j2md/terraform-j2md
とできるんじゃないかと思いました。
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.
🙆
Make it easier to use terraform-j2md from GitHub Action.