https://github.com/opencollective/opencollective-tools
https://github.com/opencollective/opencollective-tools
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/opencollective/opencollective-tools
- Owner: opencollective
- Created: 2022-01-28T21:43:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T19:33:56.000Z (6 months ago)
- Last Synced: 2024-10-29T21:38:51.110Z (6 months ago)
- Language: JavaScript
- Size: 250 KB
- Stars: 10
- Watchers: 8
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - opencollective/opencollective-tools - (JavaScript)
README
# Open Collective CLI Tools
## Prerequisite
1. Add a Personal Token (API Key) and production API URL in a `.env` file.
```
# For GitHub Sponsors AND 1kproject scripts
PERSONAL_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
API_URL=https://api.opencollective.com# For Slack scripts
# Secrets available on: https://api.slack.com/apps/A04249P7C0N/oauth
SLACK_SIGNING_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SLACK_BOT_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SLACK_USER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx
```2. Run `npm install`
## GitHub Sponsors
### CSV Import
1. Download the CSV file
2. Launch the dry run with:
`node github-sponsors/csv-import.js {CSV_FILE}`
If you see:
- "Detected a new Collective ...", it's recommended to quickly review it and add it to the `csv-import-mapping.json` file.
- "Error finding a matching Collective for GitHub Organization ...", you need to investigate and add an entry in the `csv-import-mapping.json` file.3. Happy with the dry run?
`node github-sponsors/csv-import.js {CSV_FILE} --run`
## 1kproject
To run the scripts, you need to be an admin of https://opencollective.com/ukrainian-families-1k and https://opencollective.com/foundation. Ask someone to invite you beforehand if necessary.
All scripts support the `--yubikey` option to use a yubikey instead of TOTP for 2FA.
1. Download the CSV file and name it with a shorter name like `Bulk_07_21.csv`
2. Launch the dry run for Expense Creation with:
`node 1kproject/create-expenses.js Bulk_07_21.csv`
Check any warning before proceeding, if there is a problem remove the entries from the CSV.
3. Once happy with the dry run, launch Expense Creation with:
`node 1kproject/create-expenses.js Bulk_07_21.csv --run`
4. Trigger the dry run for Expense Payment with:
`node 1kproject/pay-expenses.js`
Check that the number of approved Expenses is the expected one and that there is no warning.
5. Proceed Expense Payments with, enter your 2FA token when asked.
`node 1kproject/pay-expenses.js --run`