Skip to content
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

Merged
merged 5 commits into from
Aug 5, 2023
Merged

support GitHub Action #20

merged 5 commits into from
Aug 5, 2023

Conversation

takaishi
Copy link
Collaborator

@takaishi takaishi commented Aug 1, 2023

Make it easier to use terraform-j2md from GitHub Action.

@takaishi takaishi self-assigned this Aug 1, 2023
@takaishi takaishi requested review from okkez and akihiro17 August 1, 2023 23:54
Comment on lines +28 to +32
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
Copy link
Contributor

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

Copy link
Collaborator Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

とできるんじゃないかと思いました。

@takaishi takaishi requested review from akihiro17 and okkez August 4, 2023 00:46
Copy link
Contributor

@akihiro17 akihiro17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆

@takaishi takaishi merged commit b0a8400 into master Aug 5, 2023
@takaishi takaishi deleted the feat/add-action branch August 5, 2023 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants