From ca18dd3ea28933055798d835cb0d1852ac535217 Mon Sep 17 00:00:00 2001 From: Austen Stone Date: Fri, 5 Aug 2022 12:16:46 -0400 Subject: [PATCH] cleanup --- .github/workflows/{build_test.yaml => build_test.yml} | 0 .github/workflows/{usage.yaml => usage.yml} | 0 README.md | 4 +++- src/run.ts | 5 +++-- 4 files changed, 6 insertions(+), 3 deletions(-) rename .github/workflows/{build_test.yaml => build_test.yml} (100%) rename .github/workflows/{usage.yaml => usage.yml} (100%) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yml similarity index 100% rename from .github/workflows/build_test.yaml rename to .github/workflows/build_test.yml diff --git a/.github/workflows/usage.yaml b/.github/workflows/usage.yml similarity index 100% rename from .github/workflows/usage.yaml rename to .github/workflows/usage.yml diff --git a/README.md b/README.md index 60d13b9..7e52ee2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Seat Count Action -A simple [Action](https://docs.github.com/en/actions) to count the remaining seats in an organization. It is intended to be used in conjunction with other actions to do something like notify the user when there are less than 10 seats remaining. +A simple [Action](https://docs.github.com/en/actions) to count the remaining seats in an GitHub plan. It is intended to be used in conjunction with other actions to do something like notify the user when there are less than 10 seats remaining. + +The values output from this action could be from the organization or the enterprise depending on the [GitHub plan](https://github.com/pricing). ## Usage Create a workflow (eg: `.github/workflows/seat-count.yml`). See [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file). diff --git a/src/run.ts b/src/run.ts index 3c4057c..42e48bd 100644 --- a/src/run.ts +++ b/src/run.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core'; import * as github from '@actions/github'; +import { Endpoints } from '@octokit/types'; interface Input { token: string; @@ -18,8 +19,8 @@ const run = async (): Promise => { const input = getInputs(); const octokit: ReturnType = github.getOctokit(input.token); - const response = await octokit.request(`GET /orgs/${input.org}`); - const plan = response.data.plan; + const orgResponse = await octokit.request(`GET /orgs/${input.org}`); + const plan = orgResponse.data.plan; if (plan) { core.setOutput('name', plan.name);