Skip to content

Update mods from known repos #5631

Update mods from known repos

Update mods from known repos #5631

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Update mods from known repos
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "24 * * * *"
# Sets permissions of the GITHUB_TOKEN to allow push and requesting PRs
concurrency:
group: update-mods-${{ github.ref }}
jobs:
# Single deploy job since we're just deploying
update-mods:
runs-on: ubuntu-latest
outputs:
mod-urls: ${{ steps.get-urls.outputs.urls }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install npm modules
uses: ./.github/actions/install-modules
with:
scripts: true
- name: Update the mods from known repos.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd source/scripts
npx tsx ./update-mods.ts 2>&1
- name: Get URLs for new mods
id: get-urls
run: |
cd source/scripts
urls="$(npx tsx ./get-new-mod-urls.ts | jq -Rsc 'split("\n") | map(select(length > 0))')"
echo "$urls" | jq .
echo "urls=$urls" >> $GITHUB_OUTPUT
process-urls:
needs: update-mods
if: ${{ needs.update-mods.outputs.mod-urls != '[]' }}
permissions:
contents: write
pull-requests: write
strategy:
matrix:
url: ${{ fromJson(needs.update-mods.outputs.mod-urls) }}
uses: ./.github/workflows/import-mods.yml
with:
url: ${{ matrix.url }}