Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
manosim authored Oct 23, 2023
0 parents commit 9ec80e5
Show file tree
Hide file tree
Showing 17 changed files with 7,189 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"env": {
"node": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
}
}
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
20 changes: 20 additions & 0 deletions .github/workflows/check-linked-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check linked issues
'on':
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
jobs:
check_pull_requests:
runs-on: ubuntu-latest
name: Check linked issues
permissions:
issues: read
pull-requests: write
steps:
- uses: nearform-actions/github-action-check-linked-issues@v1
id: check-linked-issues
with:
exclude-branches: release/**, dependabot/**
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Continuous Integration

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: |
npm ci
npm run lint
npm test
automerge:
name: Merge dependabot's PRs
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3
19 changes: 19 additions & 0 deletions .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Notify release
'on':
workflow_dispatch:
schedule:
- cron: 30 8 * * *
release:
types:
- published
issues:
types:
- closed
jobs:
setup:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- uses: nearform-actions/github-action-notify-release@v1
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: release
on:
workflow_dispatch:
inputs:
semver:
description: The semver to use
required: true
default: patch
type: choice
options:
- patch
- minor
- major
pull_request:
types: [closed]

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: nearform-actions/optic-release-automation-action@v4
with:
semver: ${{ github.event.inputs.semver }}
commit-message: 'chore: release {version}'
build-command: npm ci
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
.eslintcache

# JetBrains IDEs
.idea
# Visual Studio Code
.vscode

# OS X
.DS_Store
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none"
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
![CI](https://github.com/nearform/hub-template/actions/workflows/ci.yml/badge.svg?event=push)

# Hub Template

A feature-packed template to start a new repository on the hub, including:

- code linting with [ESlint](https://eslint.org) and [prettier](https://prettier.io)
- pre-commit code linting and commit message linting with [husky](https://www.npmjs.com/package/husky) and [commitlint](https://commitlint.js.org/)
- dependabot setup with automatic merging thanks to ["merge dependabot" GitHub action](https://github.com/fastify/github-action-merge-dependabot)
- notifications about commits waiting to be released thanks to ["notify release" GitHub action](https://github.com/nearform/github-action-notify-release)
- PRs' linked issues check with ["check linked issues" GitHub action](https://github.com/nearform/github-action-check-linked-issues)
- Continuous Integration GitHub workflow
Empty file added index.js
Empty file.
Loading

0 comments on commit 9ec80e5

Please sign in to comment.