From 5b032e08150ee33eab6c688b91fdcac771a58061 Mon Sep 17 00:00:00 2001 From: Sam McLeod Date: Mon, 12 Sep 2022 11:04:06 +1000 Subject: [PATCH 1/4] update node, add docker & bash linting --- .github/pull_request_template.md | 13 ++++++++++++ .github/workflows/lint.yml | 35 ++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 2 +- Dockerfile | 4 ++-- README.md | 6 +++--- 5 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/lint.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..f05727b4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +# Summary of changes + +Do any of the followings changes break current behaviour or configuration? + +- **YES** / NO + +## How changes have been tested + +- + +## List any unknowns + +- diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..3cf9cd02 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: Lint + +on: + pull_request: + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + lint-bash: + name: Lint Bash scripts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: shellcheck + level: warning + path: . + pattern: '*.sh' + fail_on_error: true + + lint-dockerfile: + name: Lint Dockerfiles + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: hadolint + uses: reviewdog/action-hadolint@v1 + with: + level: warning + fail_on_error: true + hadolint_ignore: DL3016 DL3018 # Ignore pinning apk and npm packages to specific version with @ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3ca724e..4cfcc993 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 with: fetch-depth: '0' - name: Bump version and push tag diff --git a/Dockerfile b/Dockerfile index 6e5e2dc6..b64fc5be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM node:12-alpine3.15 +FROM node:16-alpine LABEL "repository"="https://github.com/anothrNick/github-tag-action" LABEL "homepage"="https://github.com/anothrNick/github-tag-action" LABEL "maintainer"="Nick Sjostrom" -RUN apk update && apk add bash git curl jq && npm install -g semver +RUN apk --no-cache add bash git curl jq && npm install -g semver COPY entrypoint.sh /entrypoint.sh diff --git a/README.md b/README.md index 0fc77652..bcf27949 100755 --- a/README.md +++ b/README.md @@ -22,17 +22,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: '0' - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.36.0 + uses: anothrNick/github-tag-action@1.40.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true ``` -_NOTE: set the fetch-depth for `actions/checkout@v2` to be sure you retrieve all commits to look for the semver commit message._ +_NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you retrieve all commits to look for the semver commit message._ #### Options From 3b24e06829d45053adb83f4e550e1a2122e0cd4d Mon Sep 17 00:00:00 2001 From: Sam McLeod Date: Mon, 12 Sep 2022 11:07:49 +1000 Subject: [PATCH 2/4] update node, add docker & bash linting --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3cf9cd02..77fae6eb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - uses: reviewdog/action-shellcheck@v1 with: github_token: ${{ secrets.github_token }} - reporter: shellcheck + reporter: github-pr-review level: warning path: . pattern: '*.sh' @@ -30,6 +30,7 @@ jobs: - name: hadolint uses: reviewdog/action-hadolint@v1 with: + reporter: github-pr-review level: warning fail_on_error: true hadolint_ignore: DL3016 DL3018 # Ignore pinning apk and npm packages to specific version with @ From a9a62174315a89551e5afd918f09d389aa133f4e Mon Sep 17 00:00:00 2001 From: Sam McLeod Date: Mon, 12 Sep 2022 11:12:13 +1000 Subject: [PATCH 3/4] update node, add docker & bash linting --- .github/workflows/lint.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 77fae6eb..53051556 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,6 +2,11 @@ name: Lint on: pull_request: + types: + - opened + - edited + - reopened + - synchronize workflow_dispatch: permissions: @@ -34,3 +39,15 @@ jobs: level: warning fail_on_error: true hadolint_ignore: DL3016 DL3018 # Ignore pinning apk and npm packages to specific version with @ + + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Lint Github Actions + uses: reviewdog/action-actionlint@v1 + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + reporter: github-pr-review From af22107fc76999fe837977d25cc27d874626a7c5 Mon Sep 17 00:00:00 2001 From: Sam McLeod Date: Mon, 12 Sep 2022 11:12:26 +1000 Subject: [PATCH 4/4] update node, add docker & bash linting --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 53051556..1def0f14 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,7 +40,7 @@ jobs: fail_on_error: true hadolint_ignore: DL3016 DL3018 # Ignore pinning apk and npm packages to specific version with @ - actionlint: + lint-actions: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3