-
-
Notifications
You must be signed in to change notification settings - Fork 28
36 lines (32 loc) · 1.02 KB
/
voting.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Push Voting activity to commonhaus.github.io
on:
discussion_comment:
issue_comment:
workflow_dispatch:
inputs:
comment_id:
description: "Comment id"
type: string
required: true
permissions: {}
jobs:
update-vote:
runs-on: ubuntu-latest
if: github.repository == 'commonhaus/foundation'
permissions:
actions: read
steps:
- name: Bump voting results
env:
GH_TOKEN: ${{ secrets.CF_INTERNAL_VOTES }}
COMMENT_ID: ${{ github.event.comment.node_id }}
INPUT: ${{ github.event.inputs.comment_id }}
SENDER: ${{ github.event.sender.login }}
run: |
if [[ -z "$COMMENT_ID" ]]; then
COMMENT_ID=$INPUT
fi
if [[ -n "$COMMENT_ID" ]]; then
echo "{\"comment_id\": \"${COMMENT_ID}\"}" | gh workflow run -R commonhaus/commonhaus.github.io push-votes.yml --json
echo "{\"comment_id\": \"${COMMENT_ID}\"}" | gh workflow run -R commonhaus/foundation-internal push-votes.yml --json
fi