githubstats 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/exporter.sh +16 -0
- data/.github/workflows/build.yml +13 -22
- data/CHANGELOG.md +4 -0
- data/githubstats.gemspec +1 -1
- data/lib/githubstats/version.rb +1 -1
- data/lib/githubstats.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85efd3ef7382a78839410709a66d068aa9d13de94b3da28994c8afd42dfb03c1
|
|
4
|
+
data.tar.gz: a7bbcb3ded14ef503a048724a452917b119150146c07fb5885798d69f2212a61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10e07635dbe3eeccc3773de65c0400fc907fd28f9bf5c802bbb07b67c2cef5316009705711409f051c760286d40b08691bf3f9431f15922735606037a599ea12
|
|
7
|
+
data.tar.gz: 2b57b802d0ef16fecb194e4a25ad181cb98eed71b9f46b5a958a1c8f3014b496afd2a7d9cd16b9994763a663104b519443996aa6cc186630dc6d23108f768f6c
|
data/.github/exporter.sh
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
URL="https://exporter.akerl.app/metric"
|
|
6
|
+
AUTH="Authorization: Bearer $EXPORTER_TOKEN"
|
|
7
|
+
if [[ "$JOB_STATUS" == "success" ]] ; then
|
|
8
|
+
VALUE=1
|
|
9
|
+
else
|
|
10
|
+
VALUE=0
|
|
11
|
+
fi
|
|
12
|
+
BODY="{\"name\":\"gh/${GITHUB_REPOSITORY}\",\"metrics\":[{\"name\":\"ghactions\",\"type\":\"gauge\",\"tags\":{\"repo\":\"${GITHUB_REPOSITORY}\"},\"value\":\"${VALUE}\"}]}"
|
|
13
|
+
|
|
14
|
+
echo "$BODY"
|
|
15
|
+
|
|
16
|
+
curl -i -XPOST -d "$BODY" -H"$AUTH" "$URL"
|
data/.github/workflows/build.yml
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
---
|
|
1
2
|
name: Build
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
3
|
+
'on':
|
|
4
4
|
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- "**"
|
|
9
|
+
pull_request_target:
|
|
5
10
|
jobs:
|
|
6
11
|
build:
|
|
7
12
|
name: Build
|
|
@@ -23,24 +28,10 @@ jobs:
|
|
|
23
28
|
if: github.ref_type == 'tag'
|
|
24
29
|
run: bundle exec rake release
|
|
25
30
|
env:
|
|
26
|
-
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
|
27
|
-
- name: Post to
|
|
28
|
-
|
|
29
|
-
uses: slackapi/slack-github-action@v1.23.0
|
|
31
|
+
GEM_HOST_API_KEY: "${{ secrets.GEM_HOST_API_KEY }}"
|
|
32
|
+
- name: Post to hook-exporter
|
|
33
|
+
run: "./.github/exporter.sh"
|
|
30
34
|
env:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
payload: |
|
|
35
|
-
{
|
|
36
|
-
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
|
37
|
-
"blocks": [
|
|
38
|
-
{
|
|
39
|
-
"type": "section",
|
|
40
|
-
"text": {
|
|
41
|
-
"type": "mrkdwn",
|
|
42
|
-
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
35
|
+
EXPORTER_TOKEN: "${{ secrets.EXPORTER_TOKEN }}"
|
|
36
|
+
JOB_STATUS: "${{ job.status }}"
|
|
37
|
+
if: always() && github.ref == 'refs/heads/main'
|
data/CHANGELOG.md
CHANGED
data/githubstats.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.executables = ['githubstats']
|
|
19
19
|
|
|
20
20
|
s.add_runtime_dependency 'basiccache', '~> 1.0.0'
|
|
21
|
-
s.add_runtime_dependency 'nokogiri', '~> 1.
|
|
21
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.15.3'
|
|
22
22
|
|
|
23
23
|
s.add_development_dependency 'goodcop', '~> 0.9.7'
|
|
24
24
|
s.add_development_dependency 'timecop', '~> 0.9.6'
|
data/lib/githubstats/version.rb
CHANGED
data/lib/githubstats.rb
CHANGED
|
@@ -143,7 +143,7 @@ module GithubStats
|
|
|
143
143
|
def download(to_date = nil)
|
|
144
144
|
resp = request(to_date)
|
|
145
145
|
html = Nokogiri::HTML(resp)
|
|
146
|
-
svg = html.
|
|
146
|
+
svg = html.css('table.ContributionCalendar-grid td[data-date]')
|
|
147
147
|
svg.css('.ContributionCalendar-day').map do |x|
|
|
148
148
|
x.attributes.values_at('data-date', 'data-level').map(&:value)
|
|
149
149
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: githubstats
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Les Aker
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: basiccache
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.
|
|
33
|
+
version: 1.15.3
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 1.
|
|
40
|
+
version: 1.15.3
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: goodcop
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -75,6 +75,7 @@ extensions: []
|
|
|
75
75
|
extra_rdoc_files: []
|
|
76
76
|
files:
|
|
77
77
|
- ".circle-ruby"
|
|
78
|
+
- ".github/exporter.sh"
|
|
78
79
|
- ".github/workflows/build.yml"
|
|
79
80
|
- ".gitignore"
|
|
80
81
|
- ".rspec"
|