Skip to content

Commit

Permalink
Upd: Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 25, 2024
1 parent 026fa80 commit f89c1c8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: index
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
createIndex:
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: sudo apt install -y jq

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

- name: Create index of lua scripts
run: ./index.sh

- name: Add, commit and push
uses: EndBug/[email protected]
with:
add: index.json
message: Update index
push: true
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#temporary files
*~
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"scripts":["BatteryIndicator.lua","ListenBrainz-Feedback.lua","ListenBrainz-Pin.lua","ListenBrainz-Scrobbler.lua","EnableJukebox.lua","PlayRandomPlaylist.lua","yt-dlp.lua"]}
{"scripts":["BatteryIndicator/BatteryIndicator.lua","ListenBrainz/ListenBrainz-Feedback.lua","ListenBrainz/ListenBrainz-Pin.lua","ListenBrainz/ListenBrainz-Scrobbler.lua","Misc/EnableJukebox.lua","Misc/PlayRandomPlaylist.lua","yt-dlp/yt-dlp.lua"]}
9 changes: 5 additions & 4 deletions index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ printf "{\"scripts\":[" >&3
I=0
for F in */*.lua
do
[ "$I" -gt 0 ] && printf "," >&3
SCRIPTNAME=$(basename "$F")
printf "\"%s\"" "$SCRIPTNAME" >&3
I=$((I+1))
[ "$I" -gt 0 ] && printf "," >&3
CATEGORY=$(dirname "$F")
SCRIPTNAME=$(basename "$F")
printf "\"%s/%s\"" "$CATEGORY" "$SCRIPTNAME" >&3
I=$((I+1))
done
printf "]}\n" >&3
exec 3>&-
Expand Down

0 comments on commit f89c1c8

Please sign in to comment.