diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index 664caa2..dc43808 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -32,3 +32,29 @@ jobs: branch: depup/reviewdog base: master labels: "bump:minor" + + staticcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: haya14busa/action-depup@v1 + id: depup + with: + file: script.sh + version_name: STATICCHECK_VERSION + repo: dominikh/go-tools + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "chore(deps): update staticcheck to ${{ steps.depup.outputs.latest }}" + commit-message: "chore(deps): update staticcheck to ${{ steps.depup.outputs.latest }}" + body: | + Update staticcheck to [v${{ steps.depup.outputs.latest }}](https://github.com/dominikh/go-tools/releases/tag/${{ steps.depup.outputs.latest }}) + Compare [v${{ steps.depup.outputs.current }}...${{ steps.depup.outputs.latest }}](https://github.com/gominikh/go-tools/compare/${{ steps.depup.outputs.current }}...${{ steps.depup.outputs.latest }}) + + This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3Adepup). + branch: depup/staticcheck + base: master + labels: "bump:minor" diff --git a/script.sh b/script.sh index a8c3a66..9260a14 100755 --- a/script.sh +++ b/script.sh @@ -7,13 +7,15 @@ TEMP_PATH="$(mktemp -d)" PATH="${TEMP_PATH}:$PATH" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" +STATICCHECK_VERSION="2024.1.1" echo '::group:: Installing staticcheck ... https://staticcheck.io' -curl -sfL "https://github.com/dominikh/go-tools/releases/latest/download/staticcheck_linux_amd64.tar.gz" | tar -xvz -C "${TEMP_PATH}" --strip-components=1 +curl -sfL "https://github.com/dominikh/go-tools/releases/download/${STATICCHECK_VERSION}/staticcheck_linux_amd64.tar.gz" | tar -xvz -C "${TEMP_PATH}" --strip-components=1 +staticcheck --version echo '::endgroup::' echo '::group:: Running staticcheck with reviewdog 🐶 ...' -staticcheck ${INPUT_STATICCHECK_FLAGS} -f=json ${INPUT_TARGET:-.} \ +staticcheck "${INPUT_STATICCHECK_FLAGS}" -f=json "${INPUT_TARGET:-.}" \ | jq -f "${GITHUB_ACTION_PATH}/to-rdjsonl.jq" -c | \ reviewdog \ -f="rdjsonl" \ @@ -22,7 +24,7 @@ staticcheck ${INPUT_STATICCHECK_FLAGS} -f=json ${INPUT_TARGET:-.} \ -filter-mode="${INPUT_FILTER_MODE}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ -level="${INPUT_LEVEL}" \ - ${INPUT_REVIEWDOG_FLAGS} + "${INPUT_REVIEWDOG_FLAGS}" exit_code=$? echo '::endgroup::'