-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.69 KB
/
stats.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
schedule:
- cron: '0 12 * * 1,5'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
updateOctokitStats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# fetch statistics for @octokit org
- uses: gr2m/org-stats-action@v1.x
id: stats
with:
org: octokit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# append stats to data/octokit.csv
- uses: gr2m/write-csv-file-action@v1.x
with:
path: data/octokit.csv
columns: open issues,closed issues,open pull requests,closed pull requests,merged pull requests
"open issues": ${{ fromJson(steps.stats.outputs.data).openIssues }}
"closed issues": ${{ fromJson(steps.stats.outputs.data).closedIssues }}
"open pull requests": ${{ fromJson(steps.stats.outputs.data).openPullRequests }}
"closed pull requests": ${{ fromJson(steps.stats.outputs.data).closedPullRequests }}
"merged pull requests": ${{ fromJson(steps.stats.outputs.data).mergedPullRequests }}
# push updated file back to main branch
- run: git config --local user.email "action@github.com"
- run: git config --local user.name "GitHub Action"
- run: git add data
- run: git commit -m "data/octokit.csv updated"
- run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}