setup-sdl: Use github.token as default github token, and rename to token

From a27f100fe1f5fba7c1cc35e2801ddd50c146e172 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 1 Jul 2023 03:58:00 +0200
Subject: [PATCH] Use github.token as default github token, and rename to token

---
 action.yml      | 3 ++-
 packed/index.js | 2 +-
 src/main.ts     | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/action.yml b/action.yml
index 5a5cd2b..ba1aea7 100644
--- a/action.yml
+++ b/action.yml
@@ -30,8 +30,9 @@ inputs:
   verbose:
     description: "Do a verbose build"
     default: "false"
-  github-token:
+  token:
     description: "A GitHub API token. Not required when version is 2-head, 3-head, or a git hash."
+    default: ${{ github.token }}
 outputs:
   prefix:
     description: "Actual root of the SDL package"
diff --git a/packed/index.js b/packed/index.js
index 3edfd15..fee9eab 100644
--- a/packed/index.js
+++ b/packed/index.js
@@ -353,7 +353,7 @@ function run() {
         return __generator(this, function (_a) {
             switch (_a.label) {
                 case 0:
-                    GITHUB_TOKEN = core.getInput("github-token");
+                    GITHUB_TOKEN = core.getInput("token");
                     if (GITHUB_TOKEN && GITHUB_TOKEN.length > 0) {
                         process.env.GH_TOKEN = GITHUB_TOKEN;
                         process.env.GITHUB_TOKEN = GITHUB_TOKEN;
diff --git a/src/main.ts b/src/main.ts
index 2c958bc..d4528d5 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -264,7 +264,7 @@ function get_cmake_toolchain_path(): string | undefined {
 }
 
 async function run() {
-  const GITHUB_TOKEN = core.getInput("github-token");
+  const GITHUB_TOKEN = core.getInput("token");
   if (GITHUB_TOKEN && GITHUB_TOKEN.length > 0) {
     process.env.GH_TOKEN = GITHUB_TOKEN;
     process.env.GITHUB_TOKEN = GITHUB_TOKEN;