Skip to content

Commit

Permalink
ci: add github actions for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia committed Jul 31, 2024
1 parent 056e1b0 commit 2f10aac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Tests
on:
- push
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 20
- 19
- 18
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Rocktim Saikia <rocktimthedev@gmail.com> (https://rocktim.xyz) 2020
Copyright (c) 2024 Rocktim Saikia <rocktimthedev@gmail.com> (https://github.com/sponsors/rocktimsaikia/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
25 changes: 12 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# read-git-user

Returns the GitHub username and email from the current local system.
Returns the GitHub username and email of the current system's `.gitconfig`.

> [!NOTE]
> This method retrieves the original GitHub username since the stored \
> git config name is not reliable. The name can be changed without \
> affecting the original GitHub username.
[![npm](https://img.shields.io/npm/v/read-git-user?color=bright)](https://npmjs.com/package/read-git-user)

## Install

```bash
Expand All @@ -26,19 +28,16 @@ console.log(gitUser);

## API

### readGitUser(options?)

Returns a `Promise<object>` with the parsed JSON.

#### options

##### dir
### readGitUser(options)

Type: `string`<br>
Default: `os.homedir()`
Returns a `Promise<object>` with the retrieved git config data.

The directory of the `.gitconfig` file
#### Options (`object`) :

## License
##### `dir`

MIT © [Rocktim Saikia](https://rocktim.xyz)
> Type: `string`<br>
> Default: `os.homedir()`
>
> The directory of the `.gitconfig` file. \
> This option is available in-case the config file is not in the default dir for some systems.

0 comments on commit 2f10aac

Please sign in to comment.