Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
austenstone committed Aug 5, 2022
1 parent 7e186a0 commit ca18dd3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
5 changes: 3 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,8 +19,8 @@ const run = async (): Promise<void> => {
const input = getInputs();
const octokit: ReturnType<typeof github.getOctokit> = 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);
Expand Down

0 comments on commit ca18dd3

Please sign in to comment.