GithubHelp home page GithubHelp logo

Comments (10)

crazy-max avatar crazy-max commented on July 21, 2024 1

@jlstevens

Symlinks do indeed work on gh-pages

Yes we can use symlinks on GitHub Pages but in some cases link target is not available or is based on an absolute path which cannot be resolved on the target branch.

@ranisalt

To me it was easy, I just use cp with the flag to copy the file when a symlink is encountered

Thanks for pointing this out. I think we could mitigate this behavior here. I will take a look and keep you in touch.

from ghaction-github-pages.

ranisalt avatar ranisalt commented on July 21, 2024

Meanwhile, if that's not trivial to solve, I can run something like this:

for f in ${{ env.PKGDEST }}/*; do
  if [ -L "$f" ]; then
    rp=$(realpath "$f")
    unlink "$f"
    cp "$rp" "$f"
  fi
done

To get rid of the symbolic links

from ghaction-github-pages.

crazy-max avatar crazy-max commented on July 21, 2024

@ranisalt I think it's linked to permissions issues on these files and your whole workflow where you tamper the GitHub Runner with your builduser user. Fyi, the standard user in the GitHub Runner is already sudoer. You can try to recover permissions on pkgs folder with sudo chown -R $(id -u):$(id -g) ./pkgs before the GitHub Pages step.

from ghaction-github-pages.

ranisalt avatar ranisalt commented on July 21, 2024

@crazy-max this action runs as root, it should not have any permission issues, but I will try that nevertheless

from ghaction-github-pages.

ranisalt avatar ranisalt commented on July 21, 2024

No luck. Still the same problem, even with all files owned by root (id -u and id -g)

https://github.com/ranisalt/rsaur/runs/1627374177

from ghaction-github-pages.

crazy-max avatar crazy-max commented on July 21, 2024

- run: chown -R $(id -u):$(id -g) ${{ env.PKGDEST }}

should be:

- run: sudo chown -R $(id -u):$(id -g) ${{ env.PKGDEST }}

from ghaction-github-pages.

ranisalt avatar ranisalt commented on July 21, 2024

The action already runs as superuser. It is clear that the owner and group have been updated. id -u and id -g return root.

from ghaction-github-pages.

jlstevens avatar jlstevens commented on July 21, 2024

I've just bumped into this issue after encountering the same problem. Symlinks do indeed work on gh-pages and can be quite useful (e.g to create an index.html that directs to another page).

The PR referenced above is trying to get a bunch of automatically generated symlinks pushed to gh-pages for this exact use case. Such a workflow was used successfully on Travis until we had to migrate to Github Actions.

I'll try fiddling with file ownership as suggeted above to see if I can get it working. Meanwhile any suggestions about how to address this issue would be appreciated!

from ghaction-github-pages.

ranisalt avatar ranisalt commented on July 21, 2024

@jlstevens there are no issues with the ownership, it changes nothing. You have to replace links with the actual files instead.

To me it was easy, I just use cp with the flag to copy the file when a symlink is encountered: https://github.com/ranisalt/rsaur/blob/825cf272159798d3d616f6fed8b241ce686bf7f4/.github/workflows/repo.yml#L56 where ${{ env.PKGDEST }} is where the files are, and output is where they will be copied into (the build_dir for this action)

from ghaction-github-pages.

stale avatar stale commented on July 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ghaction-github-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.