Skip to content

Update Picviewer CE+.user.js #6

Update Picviewer CE+.user.js

Update Picviewer CE+.user.js #6

Workflow file for this run

name: Build Picviewer CE+ Dist
on:
push:
branches:
- master
paths:
- 'Picviewer CE*/Picviewer CE*.user.js'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replace require paths, add timestamp, and create dist file
run: |
TIMESTAMP=$(date +%s)
sed -e "s#https://update.greasyfork.org/scripts/6158/23710/GM_config%20CN.js#http://hoothin.github.io/UserScripts/Picviewer%20CE%2B/GM_config%20CN.js?v=$TIMESTAMP#" \
-e "s#https://update.greasyfork.org/scripts/438080/1655629/pvcep_rules.js#http://hoothin.github.io/UserScripts/Picviewer%20CE%2B/pvcep_rules.js?v=$TIMESTAMP#" \
-e "s#https://update.greasyfork.org/scripts/440698/1653424/pvcep_lang.js#http://hoothin.github.io/UserScripts/Picviewer%20CE%2B/pvcep_lang.js?v=$TIMESTAMP#" \
"Picviewer CE+/Picviewer CE+.user.js" > "Picviewer CE+/dist.user.js"
- name: Commit and push dist.user.js
run: |
git config --local user.email "rixixi@gmail.com"
git config --local user.name "hoothin-update"
git add "Picviewer CE+/dist.user.js"
git commit -m "chore(Picviewer CE+): Auto-generate dist.user.js with timestamp"
git push https://${{ secrets.ACTION_SECRET }}@github.com/${{ github.repository }}