-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.24 KB
/
copy-documentation-readme-upwards.yml
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
name: copy-documentation-readme-upwards
on:
push:
branches:
- main
- dev/upm-readiness
jobs:
copy-documentation-readme-upwards:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: copy documentation readme upwards
run: |
git config user.name github-actions
git config user.email [email protected]
$readmeDir = Get-Item -Path "**/Packages/com.*/Documentation~" | Select-Object -ExpandProperty FullName
$readmeDir = $readmeDir.replace('${{ github.workspace }}/','')
echo $readmeDir
$readmeContent = gc (Get-Item -Path "**/Packages/com.*/Documentation~/README.md") -Raw
$readmeContent = $readmeContent -replace '(\[.*\])\(((?!https?:\/\/).+)\)',('$1('+$readmeDir+'/$2)')
echo $readmeContent
echo "v.s."
Set-Content ./README.md $readmeContent
$targetContent = gc README.md -Raw
echo $targetContent
if ($readmeContent -eq $targetContent) {echo "eq"} else {echo "ne"}
# Set-Content ./README.md $readmeContent
# git add ./README.md
# git commit -m 'Copied repo README from package README'
working-directory: ${{ github.workspace }}
shell: pwsh