Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Is it possible to add custom.css file during the action? #19

Closed
MAJA-Lin opened this issue Mar 7, 2022 · 2 comments
Closed

Is it possible to add custom.css file during the action? #19

MAJA-Lin opened this issue Mar 7, 2022 · 2 comments

Comments

@MAJA-Lin
Copy link

MAJA-Lin commented Mar 7, 2022

Hi,
I tried to add one more step in the github action like this:

jobs:
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    env:
      CSS_URL: https://raw.githubusercontent.com/test/custom.css

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: Logseq Publish
        uses: pengx17/logseq-publish@main

      - name: add a nojekyll file
        run: touch $GITHUB_WORKSPACE/www/.nojekyll

      - name: Copy custom css file
        run: curl ${{ env.CSS_URL }} > $GITHUB_WORKSPACE/www/static/css/custom.css

But got a permission denied error:

Run curl https://raw.githubusercontent.com/test//custom.css > $GITHUB_WORKSPACE/www/static/css/custom.css
/home/runner/work/_temp/ced[6](https://github.com/test/runs/5447190062?check_suite_focus=true#step:6:6)f8a4-26[7](https://github.com/test/runs/5447190062?check_suite_focus=true#step:6:7)8-4f9a-a5be-12c7672b73c6.sh: line 1: /home/runner/work/test/www/static/css/custom.css: Permission denied
Error: Process completed with exit code 1.

As I followed the instruction to change my .yml file, another error occurred:

Run pengx17/logseq-publish@main
Run mkdir -p /home/runner/work/test/www
mkdir: cannot create directory '/home/runner': Permission denied
Error: Process completed with exit code 1.
Run actions/upload-artifact@v2
/usr/bin/docker exec  4f61f56aa52ff49[8](https://github.com/test/runs/5447331305?check_suite_focus=true#step:5:8)5bf92f1cbc1ba461d54b7e62d17da8cbdd2ae[24](https://github.com/test/runs/5447331305?check_suite_focus=true#step:5:24)949eeed2f sh -c "cat /etc/*release | grep ^ID"
Warning: No files were found with the provided path: www/trace.zip. No artifacts will be uploaded.

Is it possible to overwrite static/css/custom.css file or include it in the step?
Thank you.

@pengx17
Copy link
Owner

pengx17 commented Mar 8, 2022

Should have been fixed by https://github.com/pengx17/logseq-publish/releases/tag/0.1.6.
The issue is that the user in Docker will be using root. I added a new step in the action.yml to make sure all files are owned by the current user (runner).

Can you try again?

@MAJA-Lin
Copy link
Author

MAJA-Lin commented Mar 8, 2022

It works perfectly for me.
Thanks a lot!

@MAJA-Lin MAJA-Lin closed this as completed Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants