|
1 | 1 | # Vote Record Actions |
2 | 2 |
|
3 | | -Common TS Actions that parse/munge vote data stored in issue comments |
4 | | -care of the [haus-rules-bot](https://github.com/commonhaus/automation). |
| 3 | +Library/Utility to parse/munge vote data stored in issue comments care of the [haus-rules-bot](https://github.com/commonhaus/automation). |
| 4 | + |
| 5 | +For version in the examples below, use `main` or a published release |
| 6 | + |
| 7 | +## Count votes action |
| 8 | + |
| 9 | +Fine grained action that looks for comments from the specified bot, and creates vote records based on the data in those comments. |
| 10 | +It can also (optionally) create a file that lists outstanding/open votes. |
| 11 | + |
| 12 | +```yaml |
| 13 | + - name: Count votes |
| 14 | + id: count_votes |
| 15 | + uses: commonhaus/vote-record-actions/.github/actions/count-votes@<version> |
| 16 | + with: |
| 17 | + repositories: "commonhaus/foundation" |
| 18 | + target_dir: "site/_generated/votes" |
| 19 | + branch: "main" |
| 20 | +``` |
| 21 | +
|
| 22 | +## Receive votes workflow |
| 23 | +
|
| 24 | +Common workflow for dealing with pushed updates related to votes. |
| 25 | +This workflow uses the count-votes action |
| 26 | +
|
| 27 | +```yaml |
| 28 | + test_votes: |
| 29 | + uses: commonhaus/vote-record-actions/.github/workflows/receive-votes.yml@<version> |
| 30 | + with: |
| 31 | + repositories: "commonhaus-test/automation-test" |
| 32 | + vote_comment_bot: "commonhaus-test-bot[bot]" |
| 33 | + removeTags: "notice" |
| 34 | + target_dir: "votes/raw" |
| 35 | + markdown_dir: "votes/results" |
| 36 | + index_file: "votes/README.md" |
| 37 | + secrets: inherit |
| 38 | +``` |
| 39 | +
|
| 40 | +For version, use `main` or a published release |
| 41 | + |
| 42 | +## Directly with node/TS |
| 43 | + |
| 44 | +"Usage: node vote-record-actions/dist/votes.js [all|recent] jsonDir [--repos=org/repo1,org/repo2] [--md=mdDir] [--removeTag=tag1] --bot=bot-comment-login" |
5 | 45 |
|
6 | 46 | ```bash |
7 | 47 | $ gh repo clone commonhaus/vote-record-actions -- --depth=1 |
8 | 48 | $ cd vote-record-actions |
9 | 49 | $ npm ci |
| 50 | +$ npm build |
10 | 51 |
|
11 | 52 | # Fetch the results from the bot comment on an issue |
12 | | -$ npm run votes ../votes IC_kwDOKRPTI86LlGLV |
| 53 | +$ node ./dist/votes.js "~/votes/raw" --repos="commonhaus/foundation" --md="~/votes/results" |
13 | 54 |
|
14 | | -# Update an index that summarizes outstanding actions |
15 | | -$ npm run index ../votes |
| 55 | +# Update an index that summarizes outstanding actions (references markdown results) |
| 56 | +$ node ./dist/genIndex.js "~/votes/raw" "~/votes/results" "~/votes/README.md" |
16 | 57 | ``` |
17 | | - |
18 | | -## Reusable workflows |
19 | | - |
20 | | -Common workflows for dealing with pushed updates related to votes. |
21 | | - |
22 | | -## Reusable actions |
23 | | - |
24 | | -Composite actions. |
|
0 commit comments