Skip to content

Commit

Permalink
feat!: update to node 20 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvcsantos authored Mar 10, 2024
1 parent 137ada8 commit c5123b0
Show file tree
Hide file tree
Showing 35 changed files with 137,484 additions and 23,311 deletions.
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{

Check warning on line 1 in .devcontainer/devcontainer.json

View workflow job for this annotation

GitHub Actions / Lint Codebase

File ignored by default.
"name": "GitHub Actions (TypeScript)",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",
"postCreateCommand": "npm install",
"customizations": {
"codespaces": {
"openFiles": ["README.md"]
},
"vscode": {
"extensions": [
"bierner.markdown-preview-github-styles",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"me-dutour-mathieu.vscode-github-actions",
"redhat.vscode-yaml",
"rvest.vs-code-prettier-eslint",
"yzhang.markdown-all-in-one"
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"markdown.extension.list.indentationSize": "adaptive",
"markdown.extension.italic.indicator": "_",
"markdown.extension.orderedList.marker": "one"
}
}
},
"remoteEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
"features": {
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/prettier:1": {}
}
}
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist/** -diff linguist-generated=true
* text=auto eol=lf

dist/** -diff linguist-generated=true
25 changes: 17 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ version: 2
updates:
- package-ecosystem: github-actions
directory: /
labels:
- dependabot
- actions
schedule:
interval: daily
interval: weekly
groups:
actions-minor:
update-types:
- minor
- patch

- package-ecosystem: npm
directory: /
labels:
- dependabot
- npm
schedule:
interval: daily
interval: weekly
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
17 changes: 17 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@
MD004:
style: dash

# Spaces after list markers
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1

# Code block style
MD046:
style: fenced

# MD013/line-length
# - Line length
MD013:
# Number of characters
line_length: 120
# Include tables
tables: false

# MD024/no-duplicate-heading/no-duplicate-header
# - Multiple headings with the same content
MD024:
allow_different_nesting: true
siblings_only: true
51 changes: 26 additions & 25 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
# In TypeScript actions, `dist/index.js` is a special file. When you reference
# an action with `uses:`, `dist/index.js` is the code that will be run. For this
# project, the `dist/index.js` file is generated from other source files through
# the build process. We need to make sure that the checked-in `dist/index.js`
# file matches what is expected from the build.
# In TypeScript actions, `dist/` is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
# expected transpiled code.
#
# This workflow will fail if the checked-in `dist/index.js` file does not match
# what is expected from the build.
name: Check dist/
# If this workflow is run from a feature branch, it will act as an additional CI
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
name: Check Transpiled JavaScript

on:
pull_request:
branches:
- main
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

permissions:
contents: read

jobs:
check-dist:
name: Check dist/
runs-on: ubuntu-latest

permissions:
contents: read
statuses: write

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .node-version
cache: npm

- name: Install Dependencies
Expand All @@ -47,7 +45,8 @@ jobs:
id: build
run: npm run bundle

- name: Compare Expected and Actual Directories
# This will fail the workflow if the PR wasn't created by Dependabot.
- name: Compare Directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
Expand All @@ -56,10 +55,12 @@ jobs:
exit 1
fi
# If index.js was different than expected, upload the expected version as
# a workflow artifact.
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
# If `dist/` was different than expected, and this was not a Dependabot
# PR, upload the expected version as a workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ name: Continuous Integration

on:
pull_request:
branches:
- main
push:
branches:
- main
- 'releases/*'

permissions:
contents: read

jobs:
test-typescript:
Expand All @@ -19,9 +23,9 @@ jobs:

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .node-version
cache: npm

- name: Install Dependencies
Expand Down Expand Up @@ -53,7 +57,7 @@ jobs:
# id: test-action
# uses: ./
# with:
# milliseconds: 1000
# milliseconds: 2000
#
# - name: Print Output
# id: output
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: CodeQL

on:
push:
pull_request:
branches:
- main
pull_request:
push:
branches:
- main
schedule:
- cron: '31 7 * * 3'

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

permissions:
actions: read
checks: write
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
Expand All @@ -34,15 +34,15 @@ jobs:

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
43 changes: 23 additions & 20 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
name: Lint Code Base
name: Lint Codebase

on:
pull_request:
branches:
- main
push:
branches-ignore:
branches:
- main

permissions:
contents: read
packages: read
statuses: write

jobs:
lint:
name: Lint Code Base
name: Lint Codebase
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: install
run: npm ci

# TODO check prettier problem
# - name: Lint Code Base
# id: super-linter
# uses: super-linter/super-linter/slim@v5
# env:
# DEFAULT_BRANCH: main
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TYPESCRIPT_DEFAULT_STYLE: prettier
# VALIDATE_JSCPD: false
# FILTER_REGEX_EXCLUDE: dist/*
- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v6
env:
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSCPD: false
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.6.0
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.6.0
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/
node_modules/
coverage/
coverage/
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2024-03-10

### Changed

- Update to Node 20

## [1.5.0] - 2024-03-09

### Added
Expand Down Expand Up @@ -34,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Re-add `fail-on-all-policy-severities` input
- Change log level on debug to another key
- Changelog level on debug to another key
- Auto-enable diagnostic mode when debug mode is enabled
- Add `fail-if-detect-fails` input to propagate detect error as action failure

Expand Down Expand Up @@ -69,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve logging
- Update dependencies and refactor action

[2.0.0]: https://github.com/tvcsantos/detect-action/compare/v1.5.0...v2.0.0
[1.5.0]: https://github.com/tvcsantos/detect-action/compare/v1.4.1...v1.5.0
[1.4.1]: https://github.com/tvcsantos/detect-action/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/tvcsantos/detect-action/compare/v1.3.0...v1.4.0
Expand Down
Loading

0 comments on commit c5123b0

Please sign in to comment.