No description
  • JavaScript 100%
Find a file
2026-08-06 11:36:42 +02:00
.github/workflows Update .github/workflows/test-action-git.yml 2026-07-28 15:05:59 +03:00
dist explain minified code 2026-07-26 13:36:41 +02:00
src update ation 2026-07-26 13:29:37 +02:00
.gitignore add pre-restart command and restart delay 2026-07-23 17:35:19 +02:00
action.yml allow running multiple commands 2026-07-26 11:05:50 +02:00
bun.lock add pre-restart command and restart delay 2026-07-23 17:35:19 +02:00
LICENSE Create LICENSE 2024-12-19 14:23:19 +01:00
package-lock.json push action 2024-12-15 14:15:44 +01:00
package.json push action 2024-12-15 14:15:44 +01:00
README.md update github username 2026-08-06 11:36:42 +02:00

Restart Ptero Action

A GitHub action to restart your Pterodactyl Panel servers.

dist is generated by running npx -p @vercel/ncc ncc build src/index.js -o dist --minify

Usage

Note

If you are using a self-hosted git instance:

  • the uses field should be https://git.stefdp.com/Stef/restart-ptero-action@main
  • the runs-on field should be the label of your own runner

Inside steps:

- uses: Stef-DP/restart-ptero-action@main
  with:
    PTERO_PANEL_URL: ${{ secrets.PTERO_PANEL_URL }}
    PTERO_PANEL_TOKEN: ${{ secrets.PTERO_PANEL_TOKEN }}
    PTERO_PANEL_SERVER_ID: ${{ secrets.PTERO_PANEL_SERVER_ID }}

Example with commands

name: Restart Server

on: workflow_dispatch

jobs:
  test-action:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Stef-DP/restart-ptero-action@main
        with:
          PTERO_PANEL_URL: ${{ secrets.PTERO_PANEL_URL }}
          PTERO_PANEL_TOKEN: ${{ secrets.PTERO_PANEL_TOKEN }}
          PTERO_PANEL_SERVER_ID: ${{ secrets.PTERO_PANEL_SERVER_ID }}
          PRE_RESTART_COMMANDS: |
            echo "my message"
            ls
            cat myFile.txt

Exmaple with delay

name: Restart Server

on: workflow_dispatch

jobs:
  test-action:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Stef-DP/restart-ptero-action@main
        with:
          PTERO_PANEL_URL: ${{ secrets.PTERO_PANEL_URL }}
          PTERO_PANEL_TOKEN: ${{ secrets.PTERO_PANEL_TOKEN }}
          PTERO_PANEL_SERVER_ID: ${{ secrets.PTERO_PANEL_SERVER_ID }}
          RESTART_DELAY: "5"

Variables

Note

on GitHub these variables go in Settings > Secrets and variables > Actions > Repository secrets

Variable Required Description Example Default
PTERO_PANEL_URL Yes Server URL of your Pterodactyl Panel (Including the scheme, http:// or https://) https://panel.example.com N/A
PTERO_PANEL_TOKEN Yes API Key (created via /account/api) ptlc_xxxx N/A
PTERO_PANEL_SERVER_ID Yes ID of the server you want to restart (It's the short UUID (8 characters) after /server/ in the server URL) 3095fbed N/A
PRE_RESTART_COMMANDS No Commands to run on the server before restarting it (split by new line) echo "hello world" N/A (no command)
RESTART_DELAY No Amount of seconds to wait before restarting the server (useful with PRE_RESTART_COMMAND) 5 N/A (no delay)
PRE_RESTART_COMMAND_STOP_ON_ERROR No Whether to restart the server if the command HTTP request fails (NOTE: This is only for the HTTP request, it won't stop if the command fails as the API doesn't say if the command succeeds or not) true false