Skip to content

Commit 2c8c691

Browse files
committed
fix(ci): markdown png not updated
1 parent 418d70b commit 2c8c691

File tree

7 files changed

+20
-69
lines changed

7 files changed

+20
-69
lines changed

.github/scripts/files/examples.yml

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,49 +39,23 @@ jobs:
3939

4040
<%- steps.split("\n").map(line => ` ${line}`).join("\n") %>
4141

42+
- name: Screenshot markdown example
43+
if: ${{ success() || failure() }}
44+
run: |
45+
node /metrics/.github/scripts/markdown_example.mjs
46+
mv metrics.markdown.png /
4247
- name: Publish examples
4348
if: ${{ success() || failure() }}
4449
run: |
4550
set +e
4651
sudo mv /metrics_renders/* ./
4752
git config user.name github-actions[bot]
4853
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
54+
git pull
4955
git add --all
5056
git commit -m "chore: update examples"
5157
git push
5258
53-
# ======================================================================================
54-
# Markdown as png (for readme updates)
55-
# ======================================================================================
56-
57-
examples-markdown:
58-
runs-on: ubuntu-latest
59-
if: "github.repository == 'lowlighter/metrics'"
60-
container: ghcr.io/lowlighter/metrics:master
61-
needs: [examples]
62-
steps:
63-
- name: Screenshot markdown example
64-
run: |
65-
node /metrics/.github/scripts/markdown_example.mjs
66-
echo "METRICS_MARKDOWN_EXAMPLE=$(base64 --wrap=0 metrics.markdown.png)" >> $GITHUB_ENV
67-
- name: Update markdown example
68-
uses: actions/github-script@v5
69-
env:
70-
METRICS_MARKDOWN_EXAMPLE: "${{ env.METRICS_MARKDOWN_EXAMPLE }}"
71-
with:
72-
script: |
73-
try {
74-
const {data:{sha}} = await github.rest.repos.getContent({...context.repo, path:"metrics.markdown.png"})
75-
console.log(`current sha: ${sha}`)
76-
github.rest.repos.createOrUpdateFileContents({
77-
...context.repo,
78-
path:"metrics.markdown.png",
79-
message:`Auto-generated metrics for run #${github.context ? github.context.runId : "0000000000"}`,
80-
content:process.env.METRICS_MARKDOWN_EXAMPLE,
81-
sha,
82-
})
83-
} catch (error) { console.log(error) }
84-
8559
# ======================================================================================
8660
# Special job used to render lowlighter/metrics repository assets
8761
# ======================================================================================
@@ -153,6 +127,7 @@ jobs:
153127
sudo mv /metrics_renders/* ./
154128
git config user.name github-actions[bot]
155129
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
130+
git pull
156131
git add --all
157132
git commit -m "chore: update examples"
158133
git push

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
docker-release:
155155
name: Publish release to GitHub registry
156156
runs-on: ubuntu-latest
157-
needs: [ action-master-test ]
157+
needs: [ action-master-test, publish-examples ]
158158
if: contains(github.event.head_commit.message, '[release]')
159159
steps:
160160
- name: Checkout repository

.github/workflows/examples.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ jobs:
664664
base: ""
665665
plugin_starlists: yes
666666
plugin_starlists_limit_repositories: 2
667-
plugin_starlists_only: 🤘 TC39
667+
plugin_starlists_only: TC39
668668
output_action: none
669669
delay: 120
670670
user: lowlighter
@@ -1132,49 +1132,23 @@ jobs:
11321132
if: ${{ success() || failure() }}
11331133

11341134

1135+
- name: Screenshot markdown example
1136+
if: ${{ success() || failure() }}
1137+
run: |
1138+
node /metrics/.github/scripts/markdown_example.mjs
1139+
mv metrics.markdown.png /
11351140
- name: Publish examples
11361141
if: ${{ success() || failure() }}
11371142
run: |
11381143
set +e
11391144
sudo mv /metrics_renders/* ./
11401145
git config user.name github-actions[bot]
11411146
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
1147+
git pull
11421148
git add --all
11431149
git commit -m "chore: update examples"
11441150
git push
11451151
1146-
# ======================================================================================
1147-
# Markdown as png (for readme updates)
1148-
# ======================================================================================
1149-
1150-
examples-markdown:
1151-
runs-on: ubuntu-latest
1152-
if: "github.repository == 'lowlighter/metrics'"
1153-
container: ghcr.io/lowlighter/metrics:master
1154-
needs: [examples]
1155-
steps:
1156-
- name: Screenshot markdown example
1157-
run: |
1158-
node /metrics/.github/scripts/markdown_example.mjs
1159-
echo "METRICS_MARKDOWN_EXAMPLE=$(base64 --wrap=0 metrics.markdown.png)" >> $GITHUB_ENV
1160-
- name: Update markdown example
1161-
uses: actions/github-script@v5
1162-
env:
1163-
METRICS_MARKDOWN_EXAMPLE: "${{ env.METRICS_MARKDOWN_EXAMPLE }}"
1164-
with:
1165-
script: |
1166-
try {
1167-
const {data:{sha}} = await github.rest.repos.getContent({...context.repo, path:"metrics.markdown.png"})
1168-
console.log(`current sha: ${sha}`)
1169-
github.rest.repos.createOrUpdateFileContents({
1170-
...context.repo,
1171-
path:"metrics.markdown.png",
1172-
message:`Auto-generated metrics for run #${github.context ? github.context.runId : "0000000000"}`,
1173-
content:process.env.METRICS_MARKDOWN_EXAMPLE,
1174-
sha,
1175-
})
1176-
} catch (error) { console.log(error) }
1177-
11781152
# ======================================================================================
11791153
# Special job used to render lowlighter/metrics repository assets
11801154
# ======================================================================================
@@ -1246,6 +1220,7 @@ jobs:
12461220
sudo mv /metrics_renders/* ./
12471221
git config user.name github-actions[bot]
12481222
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
1223+
git pull
12491224
git add --all
12501225
git commit -m "chore: update examples"
12511226
git push

source/plugins/starlists/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ with:
117117
base: ""
118118
plugin_starlists: yes
119119
plugin_starlists_limit_repositories: 2
120-
plugin_starlists_only: 🤘 TC39
120+
plugin_starlists_only: TC39
121121

122122
```
123123
<!--/examples-->

source/plugins/starlists/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
base: ""
77
plugin_starlists: yes
88
plugin_starlists_limit_repositories: 2
9-
plugin_starlists_only: 🤘 TC39
9+
plugin_starlists_only: TC39
1010
test:
1111
timeout: 1800000

source/plugins/starlists/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
3030
))
3131
const count = lists.length
3232
console.debug(`metrics/compute/${login}/plugins > starlists > found [${lists.map(({name}) => name)}]`)
33+
console.log(">>>>> DEBUG", lists.map(({name}) => name), lists.map(({name}) => imports.stripemojis(name ?? "").trim().toLocaleLowerCase()), only, ignored)
3334
lists = lists
3435
.filter(({name}) => {
3536
name = imports.stripemojis(name ?? "").trim().toLocaleLowerCase()

tests/cases/starlists.plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
token: MOCKED_TOKEN
55
plugin_starlists: 'yes'
66
plugin_starlists_limit_repositories: 2
7-
plugin_starlists_only: 🤘 TC39
7+
plugin_starlists_only: TC39
88
use_mocked_data: 'yes'
99
verify: 'yes'
1010
timeout: 1800000

0 commit comments

Comments
 (0)