Skip to content

Commit 5f32d48

Browse files
committed
Create code.yml
1 parent bbf380b commit 5f32d48

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/code.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Code
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main # ✅ Change this if your default branch is different
7+
workflow_dispatch:
8+
# schedule:
9+
# - cron: "0 0 * * *" # Every day at 00:00 UTC
10+
# - cron: "0 10 * * *" # Every day at 10:00 UTC
11+
# - cron: "0 16 * * *" # Every day at 16:00 UTC
12+
# - cron: "0 22 * * *" # Every day at 22:00 UTC
13+
14+
permissions:
15+
contents: write # ✅ To push updates or create PRs
16+
actions: read # ✅ To allow action execution
17+
18+
jobs:
19+
metrics:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
# 1️⃣ Checkout your profile repo
24+
- name: 🦑 Checkout repo
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
30+
# 2️⃣ Install jq (required by lowlighter/metrics)
31+
- name: 🦑 Install jq
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y jq
35+
36+
# Code
37+
- name: 🐙Code
38+
if: ${{ success() || failure() }}
39+
uses: lowlighter/metrics@latest
40+
with:
41+
filename: code.svg
42+
token: ${{ secrets.METRICS_TOKEN }}
43+
base: ""
44+
output_action: gist
45+
committer_gist: ${{ secrets.WORKFLOW_GIST }}
46+
plugin_code: yes
47+
plugin_code_lines: 12
48+
plugin_code_visibility: public
49+
plugin_code_languages: python
50+
51+
52+
# 9️⃣ Commit & push all SVG updates to a PR
53+
- name: 🦑 Commit & Create PR
54+
uses: peter-evans/create-pull-request@v6
55+
with:
56+
token: ${{ secrets.METRICS_TOKEN }}
57+
branch: metrics-update
58+
title: "chore: update all metrics SVGs"
59+
body: "Auto-generated metrics via iamAntimPal/metrics"

0 commit comments

Comments
 (0)