Skip to content

Check to see if a quick set-centent, get-content will result in equal… #13

Check to see if a quick set-centent, get-content will result in equal…

Check to see if a quick set-centent, get-content will result in equal… #13

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