Skip to content

Commit d53d6b2

Browse files
updated the publishing script
1 parent dc00d22 commit d53d6b2

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

β€Ž.github/scripts/update-readme.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
project="$1"
5+
app_dir="testapps/$project"
6+
7+
header="<p align=\"center\"><strong>🚨🚨🚨 This repo is just a dummy 🚨🚨🚨</strong><br>Submit issues in the <a href=\"https://github.com/tolgee/tolgee-js\" target=\"_blank\"><strong>monorepo</strong></a> or <a href=\"https://github.com/tolgee/tolgee-js/tree/main/testapps/$project\" target=\"_blank\"><strong>check the source code here</strong></a>.</p>"
8+
9+
tmp=$(mktemp)
10+
echo "$header" | cat - "$app_dir/README.md" > "$tmp"
11+
mv "$tmp" "$app_dir/README.md"

β€Ž.github/workflows/publish-examples-check.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666

6767
- name: Update README
6868
run: |
69-
echo '<p align="center"><strong>🚨🚨🚨 This repo is just a dummy 🚨🚨🚨</strong><br>Submit issues in the <a href="https://github.com/tolgee/tolgee-js" target="_blank"><strong>monorepo</strong></a> or <a href="https://github.com/tolgee/tolgee-js/tree/main/testapps/${{ matrix.project }}" target="_blank"><strong>check the source code here</strong></a>.</p>' | cat - README.md > temp && mv temp README.md
70-
working-directory: testapps/${{ matrix.project }}
69+
bash "$GITHUB_WORKSPACE/root/.github/scripts/update-readme.sh" "${{ matrix.project }}"
7170
7271
# NOT publishing here

β€Ž.github/workflows/publish-examples.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
branches: ['main']
77
types:
88
- completed
9+
workflow_dispatch:
910
jobs:
1011
publish:
11-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
1213
strategy:
1314
fail-fast: false
1415
matrix:
@@ -67,8 +68,7 @@ jobs:
6768

6869
- name: Update README
6970
run: |
70-
echo '<p align="center"><strong>🚨🚨🚨 This repo is just a dummy 🚨🚨🚨</strong><br>Submit issues in the <a href="https://github.com/tolgee/tolgee-js" target="_blank"><strong>monorepo</strong></a> or <a href="https://github.com/tolgee/tolgee-js/tree/main/testapps/${{ matrix.project }}" target="_blank"><strong>check the source code here</strong></a>.</p>' | cat - README.md > temp && mv temp README.md
71-
working-directory: testapps/${{ matrix.project }}
71+
bash "$GITHUB_WORKSPACE/root/.github/scripts/update-readme.sh" "${{ matrix.project }}"
7272
7373
- name: Commit & Push files
7474
run: |

0 commit comments

Comments
Β (0)