Coder Social home page Coder Social logo

jayanta525 / github-pages-directory-listing Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 19.0 93 KB

Directory listing for Github Pages

License: MIT License

Dockerfile 3.82% Shell 0.46% Python 79.09% HTML 16.64%
directory-listing indexing listing pages serving-directory

github-pages-directory-listing's Introduction

k

t

t

github-pages-directory-listing's People

Contributors

jayanta525 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

github-pages-directory-listing's Issues

Please add an option to overwrite existing directory listings

I am glad that this Github Action exists. I am using it to upload html reports to a separate host that does not have directory listing enabled for security reasons, and this Action helps a great deal.

However, I noticed that this extension creates new index.html files, but does not update existing files. If a folder content changes after the index.html was created, then this change will not be reflected in the directory listing.

As a workaround I added a step that deletes all existing index.html files before I create the new directory listings:

- name: "[Deploy] Delete existing directory listings"
  run: rm -rf **/index.html
  working-directory: reports

- name: "[Deploy] Generate new directory listings"
  uses: jayanta525/github-pages-directory-listing@66df212efca9ee633e4a287f4a4c0ec01665de1a
  with:
    FOLDER: reports

It would be nice if this Github Action could do it on its own. Here is a mock up for a new parameter "overwrite":

- name: "[Deploy] Update directory listings"
  uses: jayanta525/github-pages-directory-listing@66df212efca9ee633e4a287f4a4c0ec01665de1a
  with:
    FOLDER: reports
    OVERWRITE: true

deletes folder instead of filling it with html file

when i use you workflow it tells me it is successful but instead it deletes the folder
edit: it also deleted the folder it was supposed to index

.yml:
name: directory-listing
on: [push]

jobs:
pages-directory-listing-release:
runs-on: ubuntu-latest
name: Directory Listings Index
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: main #checkout different branch

  - name: Generate Directory Listings
    uses: jayanta525/[email protected]
    with:
      FOLDER: documents    #directory to generate index

  - name: Deploy to Pages
    uses: JamesIves/[email protected]
    with:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      BRANCH: main
      FOLDER: data

workflow output:
Current runner version: '2.296.1'
Operating System
Runner Image
Runner Image Provisioner
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v3' (SHA:2541b1294d2704b0964813337f33b291d3f8596b)
Download action repository 'jayanta525/[email protected]' (SHA:00c9817e589e193a844dabbdc6a179d1f77d4376)
Download action repository 'JamesIves/[email protected]' (SHA:93065a8b71cd5d57c379528f7a43a2e38d908af0)
14s
Build container for action use: '/home/runner/work/_actions/jayanta525/github-pages-directory-listing/v2.0.0/Dockerfile'.
0s
Run actions/checkout@v3
Syncing repository: 101br03k/federation-internationale-de-l-automobile
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/2a261554-fd42-4df5-8935-3e601984496b' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/federation-internationale-de-l-automobile/federation-internationale-de-l-automobile
Deleting the contents of '/home/runner/work/federation-internationale-de-l-automobile/federation-internationale-de-l-automobile'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/bin/git log -1 --format='%H'
'c0efd0ee2890cd6239a00334e9bbd0a10f8a8185'
10s
Run jayanta525/[email protected]
/usr/bin/docker run --name a9b4903fe8833ef4bf2a7eb1f05c4218269_4d1b77 --label 786a9b --workdir /github/workspace --rm -e "INPUT_FOLDER" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/federation-internationale-de-l-automobile/federation-internationale-de-l-automobile":"/github/workspace" 786a9b:4903fe8833ef4bf2a7eb1f05c4218269 "documents"
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Hit:4 https://dl.yarnpkg.com/debian stable InRelease
Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
Get:6 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [182 kB]
Fetched 8574 kB in 2s (5056 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
python3 is already the newest version (3.9.2-3).
python3 set to manually installed.
The following additional packages will be installed:
cmake-data libarchive13 libjsoncpp24 librhash0 libuv1
Suggested packages:
cmake-doc ninja-build lrzip
The following NEW packages will be installed:
cmake cmake-data libarchive13 libjsoncpp24 librhash0 libuv1
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.
Need to get 8000 kB of archives.
After this operation, 34.3 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 cmake-data all 3.18.4-2+deb11u1 [1725 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libarchive13 amd64 3.4.3-2+deb11u1 [343 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libjsoncpp24 amd64 1.9.4-4 [78.9 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 librhash0 amd64 1.4.1-2 [129 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libuv1 amd64 1.40.0-2 [132 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 cmake amd64 3.18.4-2+deb11u1 [5593 kB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 8000 kB in 0s (98.5 MB/s)
Selecting previously unselected package cmake-data.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 28116 files and directories currently installed.)
Preparing to unpack .../0-cmake-data_3.18.4-2+deb11u1_all.deb ...
Unpacking cmake-data (3.18.4-2+deb11u1) ...
Selecting previously unselected package libarchive13:amd64.
Preparing to unpack .../1-libarchive13_3.4.3-2+deb11u1_amd64.deb ...
Unpacking libarchive13:amd64 (3.4.3-2+deb11u1) ...
Selecting previously unselected package libjsoncpp24:amd64.
Preparing to unpack .../2-libjsoncpp24_1.9.4-4_amd64.deb ...
Unpacking libjsoncpp24:amd64 (1.9.4-4) ...
Selecting previously unselected package librhash0:amd64.
Preparing to unpack .../3-librhash0_1.4.1-2_amd64.deb ...
Unpacking librhash0:amd64 (1.4.1-2) ...
Selecting previously unselected package libuv1:amd64.
Preparing to unpack .../4-libuv1_1.40.0-2_amd64.deb ...
Unpacking libuv1:amd64 (1.40.0-2) ...
Selecting previously unselected package cmake.
Preparing to unpack .../5-cmake_3.18.4-2+deb11u1_amd64.deb ...
Unpacking cmake (3.18.4-2+deb11u1) ...
Setting up libarchive13:amd64 (3.4.3-2+deb11u1) ...
Setting up libuv1:amd64 (1.40.0-2) ...
Setting up libjsoncpp24:amd64 (1.9.4-4) ...
Setting up librhash0:amd64 (1.4.1-2) ...
Setting up cmake-data (3.18.4-2+deb11u1) ...
Setting up cmake (3.18.4-2+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
Cloning into 'apindex-v2'...
-- Configuring done
-- Generating done
-- Build files have been written to: /github/workspace/apindex-v2
Install the project...
-- Install configuration: ""
-- Installing: /usr/share/apindex
-- Installing: /usr/share/apindex/file.template.html
-- Installing: /usr/share/apindex/footer.template.html
-- Installing: /usr/share/apindex/index.template.html
-- Installing: /usr/share/apindex/img
-- Installing: /usr/share/apindex/img/pdf.png
-- Installing: /usr/share/apindex/img/document.png
-- Installing: /usr/share/apindex/img/script.png
-- Installing: /usr/share/apindex/img/conf.png
-- Installing: /usr/share/apindex/img/file.png
-- Installing: /usr/share/apindex/img/image.png
-- Installing: /usr/share/apindex/img/patch.png
-- Installing: /usr/share/apindex/img/folder.png
-- Installing: /usr/share/apindex/img/ar.png
-- Installing: /usr/share/apindex/img/package.png
-- Installing: /usr/share/apindex/img/music.png
-- Installing: /usr/share/apindex/img/back.png
-- Installing: /usr/share/apindex/img/sec.png
-- Installing: /usr/share/apindex/icons.xml
-- Installing: /usr/bin/apindex
Writing documents/2019/index.html
Writing documents/index.html
0s
Warning: Unexpected input(s) 'GITHUB_TOKEN', valid inputs are ['ssh-key', 'token', 'branch', 'folder', 'target-folder', 'commit-message', 'clean', 'clean-exclude', 'dry-run', 'git-config-name', 'git-config-email', 'repository-name', 'workspace', 'single-commit', 'silent']
Run JamesIves/[email protected]

GitHub Pages Deploy Action 🚀

🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues

📣 Maintained by James Ives: https://jamesiv.es
💖 Support: https://github.com/sponsors/JamesIves

Checking configuration and starting deployment… 🚦
Deploying using Deploy Token… 🔑
Configuring git…
/usr/bin/git config user.name 101br03k
/usr/bin/git config user.email [email protected]
/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
/usr/bin/git remote rm origin
/usr/bin/git remote add origin ***github.com/101br03k/federation-internationale-de-l-automobile.git
Git configured… 🔧
Starting to commit changes…
/usr/bin/git ls-remote --heads ***github.com/101br03k/federation-internationale-de-l-automobile.git refs/heads/main
531a5d45933196237e2ed8e55f62969fa1db8436 refs/heads/main
Creating worktree…
/usr/bin/git fetch --no-recurse-submodules --depth=1 origin main
From https://github.com/101br03k/federation-internationale-de-l-automobile

  • branch main -> FETCH_HEAD
  • [new branch] main -> origin/main
    /usr/bin/git worktree add --no-checkout --detach github-pages-deploy-action-temp-deployment-folder
    Preparing worktree (detached HEAD c0efd0e)
    /usr/bin/git checkout -B main origin/main
    Previous HEAD position was c0efd0e Create data
    Switched to and reset branch 'main'
    branch 'main' set up to track 'origin/main'.
    /usr/bin/rsync -q -av --checksum --progress /home/runner/work/federation-internationale-de-l-automobile/federation-internationale-de-l-automobile/data/. github-pages-deploy-action-temp-deployment-folder --delete --exclude CNAME --exclude .nojekyll --exclude .ssh --exclude .git --exclude .github
    Checking if there are files to commit…
    Running post deployment cleanup jobs… 🗑️
    /usr/bin/git checkout -B github-pages-deploy-action/w7ghuxwgt
    Switched to a new branch 'github-pages-deploy-action/w7ghuxwgt'
    /usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
    There is nothing to commit. Exiting early… 📭

1s
Post job cleanup.
/usr/bin/git version
git version 2.37.3
Temporarily overriding HOME='/home/runner/work/_temp/e817535e-0239-427f-b3ff-fb33dcbdafe4' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/federation-internationale-de-l-automobile/federation-internationale-de-l-automobile
/usr/bin/git config --local --name-only --get-regexp core.sshCommand
/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
0s
Cleaning up orphan processes

No windows support

Hi. I have a project that generates Win32 binaries and the action runs on windows. Trying to use this action says that the OS isn't supported.

OSError: [Errno 22] Invalid argument

Log is

/usr/bin/docker run --name fa40257592d65cdbcc49e581e6de20259642bb_6ddfb0 --label fa4025 --workdir /github/workspace --rm -e "INPUT_REF" -e "INPUT_FOLDER" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/key/key":"/github/workspace" fa4025:7592d65cdbcc49e581e6de20259642bb  ""
OSError: [Errno 22] Invalid argument

Action attempted

name: directory-listing
on: [push]
permissions: write-all

jobs:
  pages-directory-listing:
    runs-on: ubuntu-latest
    name: Directory Listings Index
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Generate Directory Listings
        uses: jayanta525/[email protected]
        with:
          ref: /
          
      - name: Commit and Push
        run: |
              git add .
              git commmit -m "Auto gen dir"
              git push

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.