diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-node.yml similarity index 62% rename from .github/workflows/ci.yml rename to .github/workflows/ci-node.yml index d528bd2..024b001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-node.yml @@ -4,14 +4,27 @@ # GitHub Action Workflow for continuous integration jobs. # See https://docs.github.com/en/actions and https://github.com/features/actions for more details. -name: ci +name: ci-node on: push: + paths: + - "**.js" + - "**.json" + - "**.md" + - "**.yaml" + - "**.yml" branches: - main tags: - v* pull_request: + paths: + - "**.js" + - "**.json" + - "**.md" + - "**.yaml" + - "**.yml" + jobs: lint-node: runs-on: ubuntu-latest @@ -23,11 +36,13 @@ jobs: echo "Workflow Actor: $GITHUB_ACTOR" - name: Checkout repository uses: actions/checkout@v2 - - name: "Setup Node.js version 15" + - name: Setup Node.js version 16 uses: actions/setup-node@v2.4.1 with: - node-version: "15" + node-version: "16" + # Enable this option when using this template in a repository with a lockfile. + #cache: "npm" - name: Install Node modules - run: npm install - - name: Run linters - run: npm run lint + run: npm ci + - name: Run linters in CI/CD mode + run: npm run lint:ci diff --git a/README.md b/README.md index 5d98ee2..f07c8b1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-

+

@@ -22,7 +22,7 @@ This repository serves as the base template repository of _tmpl_ that provides e - …definitions for [code owners](#code-owners) - …individual [issue templates](#issue-templates) - …a extensive [pull request template](#pull-request-template) - - …a basic [CI/CD action workflow](#cicd-action-workflow) + - …basic [CI/CD action workflows](#cicd-action-workflows) - …[automated updates and security vulnerability alerts](#automated-dependency-updates) for dependencies through the native [Dependabot][] integration - Configurations for [npm and Yarn](#nodejs-npm-and-yarn) - Basic configurations for [Git](#git) @@ -83,15 +83,15 @@ Note that the [`.github/ISSUE_TEMPLATE.md` file][gh-docs-issue_tmpl_legacy] is s The [`.github/PULL_REQUEST_TEMPLATE.md`][gh-docs-comm-pr_tmpl] file is automatically used as content when a contributor creates a new pull request. It can also be used for automation and [as URL query parameter value][gh-docs-autom_issue_pr_query] e.g. do directly link to it in documentations. -#### CI/CD Action Workflow +#### CI/CD Action Workflows -The [GitHub Actions][gh-feat-actions] `.github/workflows` directory includes a basic [CI/CD workflow file][gh-docs-act-ref-syntax] that runs for changes in the Git `main` branch and `v*` tags. There is currently one job called `lint-node` that runs all linters that are included in this template repository. See sections like [“Automatic Code and Text Formatter“](#automatic-code-and-text-formatter), [“Markdown Linting“](#markdown-linting) and [“Automatic Pre-Commit Linting“](#automatic-pre-commit-linting) below for more details. +The [GitHub Actions][gh-feat-actions] `.github/workflows` directory includes basic [CI/CD workflow files][gh-docs-act-ref-syntax] that runs for changes in the Git `main` branch and `v*` tags. There is currently one job called `lint-node` that runs all linters that are included in this template repository. See sections like [“Automatic Code and Text Formatter“](#automatic-code-and-text-formatter), [“Markdown Linting“](#markdown-linting) and [“Automatic Pre-Commit Linting“](#automatic-pre-commit-linting) below for more details. To skip a workflow, include a [supported keyword like `[skip actions]`][gh-blog-cl-skip_actions] in a commit message. #### Automated Dependency Updates To ensure dependencies of various package ecosystems are up-to-date, [Dependabot][] has been [natively integrated into GitHub][gh-blog-dependabot]. It creates [automated updates][gh-docs-dependabot] and [security vulnerability alerts][gh-docs-sec_vuls-alerts] for dependencies. -The basic [`dependabot.yml` file][gh-blob-dot_github-dependabot.yml] in this template repository contains [the configuration][gh-docs-dependabot] for [GitHub Action workflows](#cicd-action-workflow) and [Node.js dependencies](#nodejs-npm-and-yarn). +The basic [`dependabot.yml` file][gh-blob-dot_github-dependabot.yml] in this template repository contains [the configuration][gh-docs-dependabot] for [GitHub Action workflows](#cicd-action-workflows) and [Node.js dependencies](#nodejs-npm-and-yarn). Note that you must manually enable or disable [version][gh-docs-dependabot_activation] and [security][gh-docs-sec_vuls-dependabot_config] Dependabot updates per repository! diff --git a/package.json b/package.json index eb9c5f6..f16bffe 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "format": "run-s format:pretty", "format:pretty": "prettier --write .", "lint": "run-s lint:*", + "lint:ci": "run-s lint:md lint:ci:*", + "lint:ci:pretty": "prettier --loglevel silent --check .", "lint:md": "remark --no-stdout . \".github/**/*.md\"", "lint:pretty": "prettier --check .", "prepare:husky": "husky install",