Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foosel/sync-team-with-twitter-list-action
A GitHub action that syncs GitHub team members with a Twitter list.
https://github.com/foosel/sync-team-with-twitter-list-action
Last synced: 7 days ago
JSON representation
A GitHub action that syncs GitHub team members with a Twitter list.
- Host: GitHub
- URL: https://github.com/foosel/sync-team-with-twitter-list-action
- Owner: foosel
- License: mit
- Created: 2021-01-20T18:19:30.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-15T08:23:07.000Z (over 2 years ago)
- Last Synced: 2024-05-02T01:13:35.625Z (6 months ago)
- Language: JavaScript
- Size: 415 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐦 Sync GitHub team with Twitter list
This action syncs members of a GitHub team (who have listed their Twitter handle in their profile) to a Twitter list.
You probably want to run this regularly via `schedule` and maybe also manually via `workflow_dispatch`.
## Prerequisits
You'll need to create a Twitter app associated with the account that the target lists belongs to. Go to https://developer.twitter.com/en/apps for that.
You'll also need to create a GitHub personal access token for an account that's a member of the team's organization with the `org:read` permission. See https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token on how to do that.
You should add all the credentials as secrets to your workflow's repository.
## Inputs
### `github-token`
**Required** The GitHub PAT to use.
### `twitter-consumer-key`
**Required** Twitter consumer key, can be found in the Twitter app under "Keys and tokens"
### `twitter-consumer-secret`
**Required** Twitter consumer secret, can be found in the Twitter app under "Keys and tokens"
### `twitter-access-key`
**Required** Twitter access token key, can be found in the Twitter app under "Keys and tokens"
### `twitter-access-secret`
**Required** Twitter access token secret, can be found in the Twitter app under "Keys and tokens"
### `github-team`
**Required** GitHub team designator in the format `/`.
### `twitter-list`
**Required** 'Twitter list ID with which to sync'. Can be found in the URL of the list, e.g. for `https://twitter.com/i/lists/1326562334312189957` it will be `1326562334312189957`.
### `dry-run`
If set, no actual action will be performed, the action will perform a dry-run only.
## Usage
``` yaml
- uses: foosel/sync-team-with-twitter-list-action@main
with:
github-token: ${{ secrets.TEAM_MEMBER_TOKEN }}
twitter-consumer-key: ${{ secrets.TWITTER_CONSUMER_KEY }}
twitter-consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
twitter-access-key: ${{ secrets.TWITTER_ACCESS_KEY }}
twitter-access-secret: ${{ secrets.TWITTER_ACCESS_SECRET }}
github-team: "/"
twitter-list: ""
```See this repository's `` workflow for a full usage example.
## Local/standalone use
You can also run this action standalone and outside of the GitHub Action environment.
Set the following environment variables:
```
export GITHUB_TOKEN=...
export TWITTER_CONSUMER_KEY=...
export TWITTER_CONSUMER_SECRET=...
export TWITTER_ACCESS_KEY=...
export TWITTER_ACCESS_SECRET=...
export GITHUB_TEAM=...
export TWITTER_LIST=...
```and then run `node dist/index.js` (or `DRYRUN node dist/index.js` for a dry run).
## Development
### Local testing
```
export GITHUB_TOKEN=...
export TWITTER_CONSUMER_KEY=...
export TWITTER_CONSUMER_SECRET=...
export TWITTER_ACCESS_KEY=...
export TWITTER_ACCESS_SECRET=...
export GITHUB_TEAM=...
export TWITTER_LIST=...
node src/index.js
```### Build
```
npm run build
```