forked from SciTools/voted_issues
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.27 KB
/
refresh-voted-issues.yml
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
37
38
39
40
41
42
43
# Uses Github API to get a list of issues that have votes on and then
# save results into a json
name: Refresh Voted Issues
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '25 03 * * *'
# run on demand too if needed
workflow_dispatch:
jobs:
voted_main:
runs-on: ubuntu-latest
steps:
# Checkout the repo this is running in
- name: checkout this repo
uses: actions/checkout@v2
# setup python, lets default to the latest version
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
# run the python script passing in the github token
- name: Run the python
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
python query_gh_voted_issues.py
# commit the changes oonly if the file has changed
- name: Commit the changes
run: |
git config --global user.name 'votebot'
git config --global user.email '[email protected]'
git add -A
if ! git diff-index --quiet HEAD; then
git commit -m "Update the voted issues json"
git push origin main
fi