githubchart 3.4.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/exporter.sh +16 -0
- data/.github/workflows/build.yml +13 -22
- data/CHANGELOG.md +4 -0
- data/githubchart.gemspec +1 -1
- data/lib/githubchart/version.rb +1 -1
- data/lib/githubchart.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: 39a80fbfd70eb439076199998142ec5ac4e8a60494d3a160bcfc67058d200935
|
4
|
+
data.tar.gz: 4108161a4d71634fb48ba98bdb5fb85284224b72cb006874278df8d1e0d120fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65c9fed6432216d8c48391e7124558a1dc87c67e343e684300a1d56e351809440261d366ecf6996618eaccec8f116bdfe52ca15eebbafe86c2fdbbb09def2d9
|
7
|
+
data.tar.gz: 012bd1c3a898970100667837e9ee1287314d5bb2ce9166e399776d41533e7d287906b13fa9b2b73f16f73ab8e96ead2e2899ebbd9dc0fde2abaf3350ffaae386
|
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/githubchart.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.files = `git ls-files`.split
|
16
16
|
s.executables = ['githubchart']
|
17
17
|
|
18
|
-
s.add_runtime_dependency 'githubstats', '~>
|
18
|
+
s.add_runtime_dependency 'githubstats', '~> 4.0.1'
|
19
19
|
s.add_runtime_dependency 'matrix', '~> 0.4.2'
|
20
20
|
s.add_runtime_dependency 'svgplot', '~> 1.0.0'
|
21
21
|
|
data/lib/githubchart/version.rb
CHANGED
data/lib/githubchart.rb
CHANGED
@@ -83,7 +83,7 @@ module GithubChart
|
|
83
83
|
|
84
84
|
##
|
85
85
|
# Convert the data into a matrix of weeks
|
86
|
-
# The fill value is used to pad the front and
|
86
|
+
# The fill value is used to pad the front and back
|
87
87
|
|
88
88
|
def matrix(fill_value = -1)
|
89
89
|
Matrix[*@stats.pad(fill_value).each_slice(7).to_a.transpose]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubchart
|
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: githubstats
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: matrix
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +74,7 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/exporter.sh"
|
77
78
|
- ".github/workflows/build.yml"
|
78
79
|
- ".gitignore"
|
79
80
|
- ".rspec"
|