-
-
Notifications
You must be signed in to change notification settings - Fork 89
60 lines (52 loc) · 2.14 KB
/
Copy pathgittensor-impact.yml
File metadata and controls
60 lines (52 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Gittensor Impact
# Renders the README contributor-impact card with scripts/gittensor-impact-card.ts
# (our own script, styled to this repo's brand — see apps/loopover-ui/src/styles.css)
# and publishes it to the gittensor-impact-assets branch, which the README embeds
# directly. No third-party action: this replaced matthewevans/gittensor-impact-action
# once its generic template no longer matched the site's design.
on:
workflow_dispatch:
schedule:
- cron: "40 5 * * 1"
permissions:
contents: read
concurrency:
group: gittensor-impact
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
# Scoped here rather than at workflow level (defense-in-depth): this is the
# only job that needs write access, to push the rendered SVG to the
# dedicated gittensor-impact-assets branch.
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version-file: .nvmrc
- name: Render impact card
run: node --experimental-strip-types scripts/gittensor-impact-card.ts JSONbored/loopover gittensor-impact-dark.svg
- name: Publish to gittensor-impact-assets
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
workdir="$RUNNER_TEMP/gittensor-impact-publish"
rm -rf "$workdir"
mkdir -p "$workdir"
cp gittensor-impact-dark.svg "$workdir/"
cd "$workdir"
git init -b gittensor-impact-assets --quiet
git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add gittensor-impact-dark.svg
git commit -m "chore: refresh Gittensor impact card" --quiet
git push --force origin HEAD:gittensor-impact-assets