Skip to content

Commit

Permalink
Merge pull request #8 from niaid/feat-switch-account
Browse files Browse the repository at this point in the history
Initial commit for action
  • Loading branch information
jwj019 committed Mar 30, 2022
2 parents 1848026 + dfe3722 commit a0b45a4
Show file tree
Hide file tree
Showing 11 changed files with 41,790 additions and 2,853 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v2.5.1
- name: Set Node.js 12.22.6
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 12.22.6

- name: Install dependencies
run: npm ci
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
name: Test workflow

on:
push:
branches:
- main
- 'releases/*'
workflow_dispatch:
inputs:
account:
description: "Which account are you switching to?"
default: dev

jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
- run: |
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- uses: ./
with:
milliseconds: 1000
- uses: actions/checkout@v3
- name: Verify mgmt account
run: aws s3 ls
- name: Test action!
uses: ./
with:
account: ${{ github.event.inputs.account || 'dev'}}
- name: Verify target account
run: aws s3 ls
- name: Test action!
uses: ./
with:
account: mgmt
- name: Verify mgmt account again
run: aws s3 ls
13 changes: 6 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: 'Your name here'
description: 'Provide a description here'
author: 'Your name or organization here'
name: 'niaid'
description: 'Switches AWS credentials to change authentication between Monarch Spaces accounts'
author: 'niaid'
inputs:
milliseconds: # change this
account:
required: true
description: 'input description here'
default: 'default value if applicable'
description: 'Monarch Spaces account to switch to'
runs:
using: 'node16'
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit a0b45a4

Please sign in to comment.