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

use wget if curl in not installed #27

Merged
merged 10 commits into from
Aug 5, 2023
Merged
11 changes: 11 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: warning

actionlint:
name: runner / actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-actionlint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: warning
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ jobs:
with:
reviewdog_version: v0.10.0
- run: test "$(reviewdog -version)" = '0.10.0'

container:
runs-on: ubuntu-latest
container:
image: alpine:latest
steps:
- uses: actions/checkout@v3
- name: install reviewdog
uses: ./
- run: reviewdog -version
35 changes: 17 additions & 18 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
name: 'Setup reviewdog'
description: '🐶 This action sets up reviewdog'
name: "Setup reviewdog"
description: "🐶 This action sets up reviewdog"
inputs:
reviewdog_version:
description: 'reviewdog version. [latest,nightly,vX.Y.Z]'
default: 'latest'
description: "reviewdog version. [latest,nightly,vX.Y.Z]"
default: "latest"
runs:
using: 'composite'
using: "composite"
steps:
- run: $GITHUB_ACTION_PATH/install.sh
shell: bash
- name: install reviewdog
run: |
set -eu
"$GITHUB_ACTION_PATH/install.sh"
shell: sh
env:
REVIEWDOG_VERSION: ${{ inputs.reviewdog_version }}
REVIEWDOG_TEMPDIR: ${{ runner.temp }}
- run: |
if ! command -v reviewdog >/dev/null 2>&1; then
echo "reviewdog was not installed"
exit 1
fi
echo "::group::📖 reviewdog -h"
reviewdog -h 2>&1 || true
echo "::endgroup::"
shell: bash
- name: check reviewdog is successfully installed
run: |
set -eu
"$GITHUB_ACTION_PATH/check-installed.sh"
shell: sh

# Ref: https://haya14busa.github.io/github-action-brandings/
branding:
icon: 'terminal'
color: 'gray-dark'
icon: "terminal"
color: "gray-dark"
9 changes: 9 additions & 0 deletions check-installed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if ! command -v reviewdog >/dev/null 2>&1; then
echo "reviewdog was not installed"
exit 1
shogo82148 marked this conversation as resolved.
Show resolved Hide resolved
fi
echo "::group::📖 reviewdog -h"
reviewdog -h 2>&1 || true
echo "::endgroup::"
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/sh

set -euo pipefail
set -eu

VERSION="${REVIEWDOG_VERSION:-latest}"

Expand All @@ -14,7 +14,7 @@ if [ -z "${TEMP}" ]; then
fi

INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh'
if [ "${VERSION}" == 'nightly' ] ; then
if [ "${VERSION}" = 'nightly' ]; then
INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/nightly/master/install.sh'
VERSION='latest'
fi
Expand Down