From 0e9816af939c7385d9df10be1a1f2313ca0b5f14 Mon Sep 17 00:00:00 2001 From: Ashley Hutson Date: Thu, 17 Feb 2022 21:05:22 -0800 Subject: [PATCH] add in build and update for npm --- .github/dependabot.yml | 8 +++++++ .github/workflows/node.js.yml | 19 ++++++++++++++++ .gitignore | 2 +- README.md | 41 +++++++++++++++++++++++++++++++++++ package.json | 12 +++++++--- 5 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/node.js.yml create mode 100644 README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..14bc6eb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "13:00" + open-pull-requests-limit: 10 \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..5dca565 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,19 @@ +name: Node.js Package +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index d9209c1..0d45c3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules/ .node_modules/ -dist/* +dist/ test-args.txt ~*.docx \#*\# diff --git a/README.md b/README.md new file mode 100644 index 0000000..c31266d --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# gh-org-user-sync + +Syncs the members of a GitHub organization to a new GitHub organization. This application supports both `github.com` along with `GitHub Enterprise Servers`. + +## Mandatory Environment Variable + + - GH_USER_SYNC_TOKEN - GitHub API token with org admin & user access privileges. + +## Usage + +```shell +npm install -g gh-org-user-sync +``` + +After installing it, run `gh-org-user-sync --help` without arguments to see list of options: + +```console +GitHub Oranization Member Sync + +Syncs the members of a GitHub organization to a new GitHub organization +Make sure to include environment variables for the GitHub API +Token(GH_USER_SYNC_TOKEN) with org admin & user access privileges. + +Options + +-h, --help +-s, --source Source GitHub organization name (pulls users from this org) +-t, --target Target GitHub organization name (pushes users to this org) +-u, --url string GitHub API url (defaults to https://api.github.com) +-v, --verbose number Verbosity level (0-2) + +Project home: https://github.com/asheliahut/gh-org-user-sync +``` + +## Exaplining Verbose + +The `verbose` option is a number to determine the verbosity level. All levels add additional details. Further details: + + - 0: displays only the progress bar and data is visable only as syncing occurs + - 1: displays lengths of data pulled from getting users & permenant list of synced users + - 2: displays full response objects diff --git a/package.json b/package.json index ef50ccd..87a64e6 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,14 @@ "name": "gh-org-user-sync", "version": "1.0.0", "description": "Syncs the members of a GitHub organization to a new GitHub organization", + "homepage": "https://github.com/asheliahut/gh-org-user-sync", + "keywords": [ + "github", + "api", + "organization", + "user", + "sync" + ], "repository": { "type": "git", "url": "https://github.com/asheliahut/gh-org-user-sync" @@ -14,9 +22,7 @@ }, "author": "Ashley Hutson (https://screwmyprivacy.com)", "license": "Unlicense", - "bin": { - "gh-org-user-sync": "dist/gh-org-user-sync.js" - }, + "bin": "dist/gh-org-user-sync.js", "pkg": { "scripts": "dist/**/*.js" },