diff --git a/.github/workflows/ci-build-site.yml b/.github/workflows/ci-build-site.yml index 6e4b9402..ddbbc380 100644 --- a/.github/workflows/ci-build-site.yml +++ b/.github/workflows/ci-build-site.yml @@ -82,6 +82,8 @@ jobs: # Copy the generated manifest.json from the old build cp ${{ steps.set-dirs.outputs.old_dir }}/hugo/data/manifest.json ${{ steps.set-dirs.outputs.old_dir }}/manifest.json + # chown everything to the calling user as otherwise it's not possible to change it with sed and prettier later + sudo chown -R $USER:$USER ${{ steps.set-dirs.outputs.old_dir }}/public - name: Build current version run: | @@ -102,18 +104,19 @@ jobs: # Copy the generated manifest.json from the new build cp ${{ steps.set-dirs.outputs.new_dir }}/hugo/data/manifest.json ${{ steps.set-dirs.outputs.new_dir }}/manifest.json + # chown everything to the calling user as otherwise it's not possible to change it with sed and prettier later + sudo chown -R $USER:$USER ${{ steps.set-dirs.outputs.new_dir }}/public + - name: Install Prettier run: npm install -g prettier - name: Prettify CSS and JS in public directories run: | - # store in a variable because with sudo $PATH is different - prettier_cmd=$(which prettier) - sudo $prettier_cmd --write "${{ steps.set-dirs.outputs.old_dir }}/public/**/*.css" - sudo $prettier_cmd --write "${{ steps.set-dirs.outputs.old_dir }}/public/**/*.js" - sudo $prettier_cmd --write "${{ steps.set-dirs.outputs.new_dir }}/public/**/*.css" - sudo $prettier_cmd --write "${{ steps.set-dirs.outputs.new_dir }}/public/**/*.js" + prettier --write "${{ steps.set-dirs.outputs.old_dir }}/public/**/*.css" + prettier --write "${{ steps.set-dirs.outputs.old_dir }}/public/**/*.js" + prettier --write "${{ steps.set-dirs.outputs.new_dir }}/public/**/*.css" + prettier --write "${{ steps.set-dirs.outputs.new_dir }}/public/**/*.js" - name: Remove itunes:subtitle from RSS feeds before comparison run: |