Skip to content

Commit 6e5644e

Browse files
authored
Workflows: Update Playground blueprint with repo and branch. (#162)
1 parent 96dceb1 commit 6e5644e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update Blueprint Blueprint with Repository and Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- playground-ready
8+
tags:
9+
- "**"
10+
11+
jobs:
12+
update-blueprint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set Branch or Tag Name
20+
id: branch-name
21+
run: |
22+
if [ "${{ github.ref_type }}" == "branch" ]; then
23+
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV
24+
elif [ "${{ github.ref_type }}" == "tag" ]; then
25+
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV
26+
fi
27+
28+
- name: Update Blueprint JSON
29+
run: |
30+
jq --tab '.plugins[0] |= "https://github-proxy.com/proxy/?repo='$GITHUB_REPOSITORY'&branch='$CURRENT_REF'"' assets/playground/blueprint.json > assets/playground/blueprint.json.tmp
31+
mv assets/playground/blueprint.json.tmp assets/playground/blueprint.json
32+
33+
- name: Commit and Push Changes
34+
run: |
35+
if git diff --cached --quiet; then
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38+
git add assets/playground/blueprint.json
39+
git commit -m "Update blueprint.json for branch/tag ${{ env.name }}"
40+
git push
41+
fi
42+
env:
43+
name: ${{ env.name }}
44+

0 commit comments

Comments
 (0)