Skip to content
/ ghaws Public

Helpers to interact between GitHub Actions and AWS

License

Notifications You must be signed in to change notification settings

2iq/ghaws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghaws - GitHub Actions and AWS

Helpers to interact between GitHub Actions and AWS.

Summary

ghaws is a small lib that collects helpers to interact between GitHub Actions and AWS.

At the moment, there is only one functionality: Create AWS credentials and upload those to GitHub Repo as Actions secrets.

Usage

You can use it as a library in your project or as a CLI tool.

Usage as a CLI tool

CLI Installation

To use it globally, you can install it via npm:

npm install -g @2iq/ghaws

After the step above, you should be able to execute it:

$ ghaws ...
...

It's also possible to use it as a local dependency. In the example below, you can see how to add it as a dependency to the package.json file:

{
  // ...
  "devDependencies": {
    "@2iq/ghaws": "0.0.1",
    // ...
  },
  // ...
}

After npm install, the lib is available and can be called via npx:

$ npx ghaws ...
...

CLI Usage

The CLI usage should be evident from the --help output:

Options:
      --help          Show help                                        [boolean]
      --version       Show version number                              [boolean]
  -o, --organization  Specify GitHub organization
                                            [string] [required] [default: "2iq"]
  -r, --repository    Specify GitHub repository name         [string] [required]
  -a, --aws-account   Specify AWS account to be used         [string] [required]

Usage as a lib

First, add a ghaws dependency to the package.json file:

{
  // ...
  "dependencies": {
    "@2iq/ghaws": "0.0.1",
    // ...
  },
  // ...
}

Then you can use it in the code:

import ghaws from '@2iq/ghaws';

// ...

const config = {
  orgaName: 'GitHub organization',
  repoName: 'GitHub repository name',
  awsAccountName: 'AWS account name',
};

ghaws(config);

The last call will create new AWS credentials and upload them to the given GitHub repository secrets.