-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflows: Update Playground blueprint with repo and branch. (#162)
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Update Blueprint Blueprint with Repository and Branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- playground-ready | ||
tags: | ||
- "**" | ||
|
||
jobs: | ||
update-blueprint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Branch or Tag Name | ||
id: branch-name | ||
run: | | ||
if [ "${{ github.ref_type }}" == "branch" ]; then | ||
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV | ||
elif [ "${{ github.ref_type }}" == "tag" ]; then | ||
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
- name: Update Blueprint JSON | ||
run: | | ||
jq --tab '.plugins[0] |= "https://github-proxy.com/proxy/?repo='$GITHUB_REPOSITORY'&branch='$CURRENT_REF'"' assets/playground/blueprint.json > assets/playground/blueprint.json.tmp | ||
mv assets/playground/blueprint.json.tmp assets/playground/blueprint.json | ||
- name: Commit and Push Changes | ||
run: | | ||
if git diff --cached --quiet; then | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add assets/playground/blueprint.json | ||
git commit -m "Update blueprint.json for branch/tag ${{ env.name }}" | ||
git push | ||
fi | ||
env: | ||
name: ${{ env.name }} | ||
|