Skip to content

Commit

Permalink
Merge pull request #1 from reviewdog/init
Browse files Browse the repository at this point in the history
init
  • Loading branch information
haya14busa authored Aug 8, 2020
2 parents bd4f970 + 877cd06 commit df3bb98
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: release
on:
push:
branches:
- master
tags:
- 'v*.*.*'
pull_request:
types:
- labeled

jobs:
release:
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Bump version on merging Pull Requests with specific labels.
# (bump:major,bump:minor,bump:patch)
- id: bumpr
if: "!startsWith(github.ref, 'refs/tags/')"
uses: haya14busa/action-bumpr@v1

# Update corresponding major and minor tag.
# e.g. Update v1 and v1.2 when releasing v1.2.3
- uses: haya14busa/action-update-semver@v1
if: "!steps.bumpr.outputs.skip"
with:
tag: ${{ steps.bumpr.outputs.next_version }}

# Get tag name.
- id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}

# Create release.
- uses: actions/create-release@v1
if: "steps.tag.outputs.value != ''"
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.value }}
release_name: Release ${{ steps.tag.outputs.value }}
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false

release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
76 changes: 76 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: reviewdog
on:
push:
branches:
- master
pull_request:
jobs:
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: "github-pr-review"
if_false: "github-check"
- uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: ${{ steps.reporter.outputs.value }}
level: warning

test-shell:
name: runner / suggester / shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install mvdan/sh
run: |
mkdir -p $HOME/bin
curl -sfL https://install.goreleaser.com/github.com/mvdan/sh.sh | sh -s -- -b $HOME/bin
echo ::add-path::$HOME/bin
- run: shfmt -i 2 -ci -w .
- name: suggester / shfmt
uses: reviewdog/action-suggester@master
with:
tool_name: shfmt

# Need to install latest shellcheck to use diff output format as of writing (2020/08/03).
- name: install shellcheck
run: |
scversion="latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
sudo cp "shellcheck-${scversion}/shellcheck" /usr/local/bin/
rm -rf "shellcheck-${scversion}/shellcheck"
- run: shellcheck -f diff $(shfmt -f .) | patch -p1
- name: suggester / shellcheck
uses: reviewdog/action-suggester@master
with:
tool_name: shellcheck

misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: warning
locale: "US"

alex:
name: runner / alex
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-alex@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: warning
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2

- name: install reviewdog (default)
uses: ./
- run: reviewdog -version

- name: install reviewdog (nightly)
uses: ./
with:
reviewdog_version: nightly
- run: reviewdog -version | grep nightly

- name: install reviewdog (with reviewdog_version)
uses: ./
with:
reviewdog_version: v0.10.0
- run: test "$(reviewdog -version)" = '0.10.0'
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 haya14busa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# reviewdog/action-setup

[![Test](https://github.com/reviewdog/action-setup/workflows/Test/badge.svg)](https://github.com/reviewdog/action-setup/actions?query=workflow%3ATest)
[![reviewdog](https://github.com/reviewdog/action-setup/workflows/reviewdog/badge.svg)](https://github.com/reviewdog/action-setup/actions?query=workflow%3Areviewdog)
[![release](https://github.com/reviewdog/action-setup/workflows/release/badge.svg)](https://github.com/reviewdog/action-setup/actions?query=workflow%3Arelease)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/reviewdog/action-setup?logo=github&sort=semver)](https://github.com/reviewdog/action-setup/releases)
[![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr)

This action installs [reviewdog](https://github.com/reviewdog/reviewdog).

## Input
```yaml
inputs:
reviewdog_version:
description: 'reviewdog version. [latest,nightly,vX.Y.Z]'
default: 'latest'
```
## Usage
### Latest
```yaml
steps:
- uses: reviewdog/action-setup@v1
- run: reviewdog -version
```
### Specify reviewdog version
```yaml
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.10.1
- run: reviewdog -version
```
### Nightly
```yaml
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: nightly
- run: reviewdog -version
```

0 comments on commit df3bb98

Please sign in to comment.