Skip to content

Update RuneLite Types #222

Update RuneLite Types

Update RuneLite Types #222

name: Update RuneLite Types
on:
schedule:
# Run every day at 7 AM PST (3 PM UTC)
- cron: '0 15 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.repository }}-update-runelite
cancel-in-progress: true
permissions:
actions: write
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
- name: Ensure on default branch (not detached HEAD)
shell: bash
run: |
BRANCH="${{ github.event.repository.default_branch }}"
# Create/switch local branch pointer to avoid detached HEAD
git checkout -B "$BRANCH"
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
cache: 'pnpm'
cache-dependency-path: 'scripts/runelite-to-ts/pnpm-lock.yaml'
- name: Run update script
run: ./scripts/update-runelite.sh
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
id: commit
with:
message: "chore: update RuneLite TypeScript definitions"
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
add: '.'
push: false
- name: Bump patch version and push
if: steps.commit.outputs.committed == 'true'
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Bump patch version, create tag and commit
pnpm version patch -m "chore: release %s"
# Push commit and tags
git push
git push --tags
- name: Trigger publish workflow
if: steps.commit.outputs.committed == 'true'
run: gh workflow run publish.yaml --ref ${{ github.event.repository.default_branch }}
env:
GH_TOKEN: ${{ github.token }}