Merge branch 'main' of https://github.com/sinazadeh/userscripts #86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update userscript meta | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| paths: | |
| - '*.user.js' | |
| jobs: | |
| extract_meta: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Extract metadata for all userscripts | |
| run: | | |
| shopt -s nullglob | |
| for file in *.user.js; do | |
| if [[ "$file" != *.meta.js ]]; then | |
| out="${file%.user.js}.meta.js" | |
| echo "Generating $out from $file" | |
| sed -n '/^\/\/ ==UserScript==$/,/^\/\/ ==\/UserScript==$/p' "$file" > "$out" | |
| fi | |
| done | |
| - name: Commit generated meta files | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: 'chore: update userscript meta' | |
| file_pattern: '*.meta.js' | |
| commit_user_name: 'github-actions' | |
| commit_user_email: 'actions@github.com' |