mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-01-12 22:49:53 +08:00
Script to sync stars
This commit is contained in:
4
Gemfile
4
Gemfile
@@ -10,4 +10,8 @@ group :jekyll_plugins do
|
||||
gem 'jekyll-livereload'
|
||||
end
|
||||
|
||||
group :scripts do
|
||||
gem 'octokit'
|
||||
end
|
||||
|
||||
gem 'rb-fsevent', '0.9.8' # See issue https://github.com/guard/listen/issues/431
|
||||
|
||||
@@ -8,7 +8,7 @@ organizations:
|
||||
- linuxfoundation
|
||||
- kubernetes
|
||||
- nodejs
|
||||
stars: 142
|
||||
stars: 19
|
||||
installs: 48
|
||||
author: bkeepers
|
||||
repository: probot/dco
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: Duplicate Issues
|
||||
description: Identify duplicate issues
|
||||
description: Automatically detects duplicate issues
|
||||
slug: dup
|
||||
stars: 14
|
||||
stars: 15
|
||||
installs: 4
|
||||
author: MarshallOfSound
|
||||
repository: MarshallOfSound/probot-issue-duplicate-detection
|
||||
|
||||
@@ -4,7 +4,7 @@ description: Pull Requests for repository settings
|
||||
slug: settings
|
||||
topics:
|
||||
- administration
|
||||
stars: 114
|
||||
stars: 121
|
||||
installs: 38
|
||||
author: bkeepers
|
||||
repository: probot/configurer
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Snooze
|
||||
description: Temporarily close Issues and Pull Requests
|
||||
slug: snooze
|
||||
author: jbjonesjr
|
||||
stars: 2
|
||||
stars: 3
|
||||
installs: 5
|
||||
repository: jbjonesjr/probot-snooze
|
||||
---
|
||||
|
||||
@@ -15,7 +15,7 @@ organizations:
|
||||
- github
|
||||
- npm
|
||||
author: bkeepers
|
||||
stars: 112
|
||||
stars: 124
|
||||
installs: 305
|
||||
repository: probot/stale
|
||||
---
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Work In Progress
|
||||
description: Prevent merging of unfinished Pull Requests
|
||||
slug: wip
|
||||
author: gr2m
|
||||
stars: 4
|
||||
stars: 5
|
||||
installs: 7
|
||||
repository: gr2m/wip-bot
|
||||
---
|
||||
|
||||
18
script/sync-stars
Executable file
18
script/sync-stars
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env ruby
|
||||
# Sync star counts from GitHub
|
||||
|
||||
require "octokit"
|
||||
client = Octokit::Client.new(:access_token => ENV["GITHUB_TOKEN"])
|
||||
|
||||
require "jekyll"
|
||||
config = Jekyll.configuration("source" => File.expand_path('../', File.dirname(__FILE__)))
|
||||
site = Jekyll::Site.new(config)
|
||||
site.read
|
||||
|
||||
site.collections["apps"].docs.each do |app|
|
||||
repo = client.repository(app['repository'])
|
||||
|
||||
content = File.read(app.path)
|
||||
content.sub!(/^stars: \d+$/, "stars: #{repo[:stargazers_count]}")
|
||||
File.write(app.path, content)
|
||||
end
|
||||
Reference in New Issue
Block a user