-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lazybytez/feature/fix-lint-issues
Fix linter issues
- Loading branch information
Showing
8 changed files
with
190 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ insert_final_newline = true | |
trim_trailing_whitespace = false | ||
|
||
[*.yaml,*.yml] | ||
indent_size = 2 | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
--- | ||
name: Git | ||
|
||
on: | ||
pull_request: | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
# Verify that the branch name matches the format | ||
verify_branch_name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check branch name | ||
uses: deepakputhraya/action-branch-name@master | ||
with: | ||
regex: '([a-zA-Z0-0-])+\/([a-zA-Z0-0-])+' | ||
allowed_prefixes: "feature,hotfix,release,renovate" | ||
ignore: main,develop | ||
# Verify that the branch name matches the format | ||
verify_branch_name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check branch name | ||
uses: deepakputhraya/action-branch-name@master | ||
with: | ||
regex: '([a-zA-Z0-0-])+\/([a-zA-Z0-0-])+' | ||
allowed_prefixes: "feature,hotfix,release,renovate" | ||
ignore: main,develop | ||
|
||
# Verify that the commits matches the format | ||
verify_commit_messages: | ||
if: (github.actor!= 'renovate[bot]') && (contains(github.head_ref, 'renovate/github_actions/') == false) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run commitlint | ||
uses: wagoid/commitlint-github-action@v2 | ||
with: | ||
configFile: commitlint.config.js | ||
# Verify that the commits matches the format | ||
verify_commit_messages: | ||
if: (github.actor!= 'renovate[bot]') && (contains(github.head_ref, 'renovate/github_actions/') == false) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run commitlint | ||
uses: wagoid/commitlint-github-action@v2 | ||
with: | ||
configFile: commitlint.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
--- | ||
# From: https://github.com/actions/javascript-action/blob/main/.github/workflows/linter.yml | ||
name: Lint Code Base | ||
|
||
on: | ||
pull_request: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Lint Code Base | ||
runs-on: ubuntu-latest | ||
lint: | ||
name: Lint Code Base | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
|
||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
- name: Setup Node.js | ||
id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Install Dependencies | ||
id: install | ||
run: npm ci | ||
- name: Install Dependencies | ||
id: install | ||
run: npm ci | ||
|
||
- name: Lint Code Base | ||
id: super-linter | ||
uses: super-linter/super-linter/slim@v5 | ||
env: | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JAVASCRIPT_DEFAULT_STYLE: prettier | ||
VALIDATE_JSCPD: false | ||
- name: Lint Code Base | ||
id: super-linter | ||
uses: super-linter/super-linter/slim@v5 | ||
env: | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JAVASCRIPT_DEFAULT_STYLE: prettier | ||
VALIDATE_JSCPD: false | ||
FILTER_REGEX_EXCLUDE: "dist/.*" | ||
VALIDATE_EDITORCONFIG: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
coverage/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,46 +5,46 @@ | |
[![gh-stars-badge][gh-stars-badge]][gh-stars] | ||
|
||
## Description | ||
This action allows to synchronize one or more markdown files to BookStack. | ||
This action allows to synchronize one or more Markdown files to BookStack. | ||
This makes it possible to maintain documentation within a repository while still | ||
making it available in your central documentation solution. | ||
|
||
This action features: | ||
- Sync to either a chapter or a book | ||
- Use either a single file or a glob pattern to sync multiple files | ||
- Keep your pages up to date - the action can create and update pages | ||
- Sync to either a chapter or a book | ||
- Use either a single file or a glob pattern to sync multiple files | ||
- Keep your pages up to date - the action can create and update pages | ||
|
||
## Limitations | ||
- To support globs and therefore the creation of multiple pages at once, this action uses the **first** headline of type **# (h1)** as the name for the pages | ||
- Your markdown files **must** have at least one **#** to be accepted by the Action | ||
- The sync is currently one way, so deleting files from the repo won't delete the pages from BookStack | ||
- We always push an update to BookStack which generates additional traffic, however, BookStack won't create additional revisions if the content is unchanged | ||
- You must grab the book/chapter id from the database or using the API to configure the action | ||
- To support globs and therefore the creation of multiple pages at once, this action uses the **first** headline of type **# (h1)** as the name for the pages | ||
- Your Markdown files **must** have at least one **#** to be accepted by the Action | ||
- The sync is currently one way, so deleting files from the repository won't delete the pages from BookStack | ||
- We always push an update to BookStack which generates additional traffic, however, BookStack won't create additional revisions if the content is unchanged | ||
- You must grab the book/chapter ID from the database or using the API to configure the action | ||
|
||
## Inputs | ||
|
||
### `url` | ||
- **Required** | ||
- The URL to your BookStack instance, where the files will be synced to. | ||
- **Required** | ||
- The URL to your BookStack instance, where the files will be synced to. | ||
|
||
### `token-id` | ||
- **Required** | ||
- The id of your BookStack API connection. | ||
- **Required** | ||
- The ID of your BookStack API connection. | ||
|
||
### `token-secret` | ||
- **Required** | ||
- The secret of your BookStack API connection. | ||
- **Required** | ||
- The secret of your BookStack API connection. | ||
|
||
### `book-id` | ||
- **Required, when `chapter-id` is not set** | ||
- The ID of the book to sync to. | ||
- **Required, when `chapter-id` is not set** | ||
- The ID of the book to sync to. | ||
|
||
### `chapter-id` | ||
- **Required, when `book-id` is not set** | ||
- The ID of the book to sync to. | ||
- **Required, when `book-id` is not set** | ||
- The ID of the book to sync to. | ||
|
||
### `path` | ||
- The path to the markdown file(s) to sync, you can use glob patterns for multiple files | ||
- The path to the Markdown file(s) to sync, you can use glob patterns for multiple files | ||
|
||
## Outputs | ||
This action does not output anything, if everything goes well. | ||
|
@@ -54,22 +54,22 @@ This action does not output anything, if everything goes well. | |
```yaml | ||
uses: lazybytez/[email protected] | ||
with: | ||
bookstack-url: 'https://bookstack.your.url' | ||
bookstack-token-id: '{{ secrets.BOOKSTACK_TOKEN_ID }}' | ||
bookstack-token-secret: '{{ secrets.BOOKSTACK_TOKEN_SECRET }}' | ||
# You only need one of book-id or chapter-id | ||
book-id: 123 | ||
chapter-id: 123 | ||
# You can either use a path to a file or a glob pattern: | ||
path: 'sub/directories/README.md' | ||
path: 'sub/*/*.md' | ||
bookstack-url: 'https://bookstack.your.url' | ||
bookstack-token-id: '{{ secrets.BOOKSTACK_TOKEN_ID }}' | ||
bookstack-token-secret: '{{ secrets.BOOKSTACK_TOKEN_SECRET }}' | ||
# You only need one of book-id or chapter-id | ||
book-id: 123 | ||
chapter-id: 123 | ||
# You can either use a path to a file or a glob pattern: | ||
path: 'sub/directories/README.md' | ||
path: 'sub/*/*.md' | ||
``` | ||
## Development | ||
To develop locally, you should install **NodeJS 20**. | ||
The following commands can be used for local development: | ||
``` | ||
```shell | ||
# Install dependencies | ||
$ npm install | ||
|
||
|
@@ -87,7 +87,7 @@ Be sure to always run the bundler and commit the `dist/` directory when doing ch | |
|
||
## Contributing | ||
|
||
If you want to take part in contribution, like fixing issues and contributing directly to the code base, please visit | ||
If you want to take part in contribution, like fixing issues and contributing directly to the codebase, please visit | ||
the [How to Contribute][gh-contribute] document. | ||
|
||
## Useful links | ||
|
@@ -100,7 +100,7 @@ the [How to Contribute][gh-contribute] document. | |
|
||
<hr> | ||
|
||
###### Copyright (c) [Lazy Bytez][gh-team]. All rights reserved | Licensed under the MIT license. | ||
Copyright (c) [Lazy Bytez][gh-team]. All rights reserved | Licensed under the MIT license. | ||
|
||
<!-- Variables --> | ||
|
||
|
Oops, something went wrong.