Skip to content

Commit 8e64737

Browse files
committed
feat: init release
0 parents  commit 8e64737

15 files changed

+50550
-0
lines changed

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm"
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
commit-message:
13+
prefix: "fix"
14+
prefix-development: "chore"
15+
include: "scope"
16+
- package-ecosystem: "github-actions"
17+
directory: "/" # Location of package manifests
18+
schedule:
19+
interval: "daily"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release on Merge to Main
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
runs-on: ubuntu-18.04
9+
concurrency: ${{ github.ref }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '12'
15+
- run: yarn install
16+
- run: yarn package
17+
- name: Semantic Release
18+
id: semantic
19+
uses: cycjimmy/semantic-release-action@v2
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
semantic_version: 17
24+
extra_plugins: |
25+
@semantic-release/changelog
26+
@semantic-release/git
27+
@semantic-release/github
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test on Pull Requests
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-18.04
8+
concurrency: ${{ github.ref }}
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: '12'
14+
- run: yarn install
15+
- run: yarn lint
16+
- name: commit linting changes
17+
uses: stefanzweifel/[email protected]
18+
with:
19+
commit_message: ":robot: yarn lint [skip ci]"
20+
- run: yarn test

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check [existing open](https://github.com/scribd/amazon-appmesh-virtual-node/issues), or [recently closed](https://github.com/scribd/amazon-appmesh-virtual-node/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *master* branch.
27+
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34+
3. Ensure local tests pass.
35+
4. Commit to your fork using clear commit messages.
36+
5. Send us a pull request, answering any default questions in the pull request interface.
37+
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38+
39+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41+
42+
43+
## Finding contributions to work on
44+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/scribd/amazon-appmesh-virtual-node/labels/help%20wanted) issues is a great place to start.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Scribd, Inc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
## Amazon App Mesh Virtual Node Action for GitHub Actions
2+
3+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
4+
5+
Creates an Amazon App Mesh Virtual Node
6+
7+
**Table of Contents**
8+
9+
<!-- toc -->
10+
11+
- [Amazon App Mesh Virtual Node Action for GitHub Actions](#amazon-app-mesh-virtual-node-action-for-github-actions)
12+
- [Usage](#usage)
13+
- [Creating the resource](#creating-the-resource)
14+
- [Deleting the resource](#deleting-the-resource)
15+
- [Credentials and Region](#credentials-and-region)
16+
- [Permissions](#permissions)
17+
- [Troubleshooting](#troubleshooting)
18+
19+
<!-- tocstop -->
20+
21+
## Usage
22+
23+
### Creating the resource
24+
25+
```yaml
26+
- name: App Mesh Virtual Node
27+
uses: scribd/amazon-appmesh-virtual-node@master
28+
with:
29+
name: my-virtual-node
30+
mesh-name: my-mesh-name
31+
spec: |
32+
{
33+
"httpRoute": {
34+
"action": {
35+
"weightedTargets": [
36+
{
37+
"virtualNode": "my-virtual-node",
38+
"weight": 1
39+
}
40+
]
41+
},
42+
"match": {
43+
"prefix": "/"
44+
}
45+
}
46+
}
47+
tags: |
48+
[
49+
{
50+
"key": "tags-must",
51+
"value": "be-passed-in-as-a-json-string"
52+
},
53+
{
54+
"key": "this-is-because",
55+
"value": "GitHub Actions translates these values into Environment Variables"
56+
}
57+
]
58+
```
59+
### Deleting the resource
60+
61+
Deleting the resource requires `name`, `mesh-name`, and `action` to be specified as `delete`. `mesh-owner` may be supplied if required. Any additional parameters will be ignored.
62+
63+
```yaml
64+
- name: App Mesh Virtual Node
65+
uses: scribd/amazon-appmesh-virtual-node@master
66+
with:
67+
name: my-virtual-node
68+
mesh-name: my-mesh-name
69+
action: delete
70+
```
71+
72+
See [action.yml](action.yml) for the full documentation for this action's inputs and outputs.
73+
74+
75+
## Credentials and Region
76+
77+
This action relies on the [default behavior of the AWS SDK for Javascript](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html) to determine AWS credentials and region.
78+
Use [the `aws-actions/configure-aws-credentials` action](https://github.com/aws-actions/configure-aws-credentials) to configure the GitHub Actions environment with environment variables containing AWS credentials and your desired region.
79+
80+
We recommend following [Amazon IAM best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) for the AWS credentials used in GitHub Actions workflows, including:
81+
* Do not store credentials in your repository's code. You may use [GitHub Actions secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) to store credentials and redact credentials from GitHub Actions workflow logs.
82+
* [Create an individual IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) with an access key for use in GitHub Actions workflows, preferably one per repository. Do not use the AWS account root user access key.
83+
* [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) to the credentials used in GitHub Actions workflows. Grant only the permissions required to perform the actions in your GitHub Actions workflows. See the Permissions section below for the permissions required by this action.
84+
* [Rotate the credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#rotate-credentials) used in GitHub Actions workflows regularly.
85+
* [Monitor the activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#keep-a-log) of the credentials used in GitHub Actions workflows.
86+
87+
## Permissions
88+
89+
This action requires the following minimum set of permissions:
90+
91+
```json
92+
{
93+
"Version":"2012-10-17",
94+
"Statement":[
95+
{
96+
"Sid":"DeployNode",
97+
"Effect":"Allow",
98+
"Action":[
99+
"appmesh:DescribeVirtualNode",
100+
"appmesh:DeleteGatewayRoute",
101+
"appmesh:CreateVirtualNode"
102+
],
103+
"Resource":[
104+
"arn:aws:appmesh:us-east-1:1234567890:mesh/my-mesh-name/virtualNode/my-virtual-node"
105+
]
106+
}
107+
]
108+
}
109+
```
110+
111+
112+
## Troubleshooting
113+
114+
This action emits debug logs to help troubleshoot deployment failures. To see the debug logs, create a secret named `ACTIONS_STEP_DEBUG` with value `true` in your repository.
115+
116+
To run this action from your workstation, you should supply your environment variables with the `env` command, since BASH will (correctly) refuse to set environment variables with dashes in them.
117+
118+
If submitting an issue, please include output styled after the following example, it'll help greatly! Don't forget to redact any sensitive data from your submission.
119+
120+
See this example:
121+
122+
```bash
123+
env 'ACTIONS_STEP_DEBUG=true' "GITHUB_WORKSPACE=$(pwd)" 'AWS_REGION=us-east-1' 'INPUT_SPEC={"a": "b", "c": [{"d": "e"}]}' 'INPUT_MESH-NAME=example-mesh' 'INPUT_NAME=my-service' 'INPUT_TAGS=[{"Key": "hello", "Value": "world"}]' node index.js
124+
```
125+
126+
# Development
127+
128+
Releases are cut using [semantic-release](https://github.com/semantic-release/semantic-release).
129+
130+
Please write commit messages following [Angular commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines)

action.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Amazon App Mesh Virtual Node Action for GitHub Actions'
2+
description: 'Creates an Amazon App Mesh Virtual Node'
3+
branding:
4+
icon: 'cloud'
5+
color: 'orange'
6+
inputs:
7+
action:
8+
description: 'Whether to create or delete the resource. `create` is the default.'
9+
required: false
10+
name:
11+
description: 'The name of the Virtual Node'
12+
required: true
13+
mesh-name:
14+
description: 'The name of the App Mesh Mesh.'
15+
required: true
16+
spec:
17+
description: 'The Virtual Node specification as a JSON string.'
18+
required: true
19+
mesh-owner:
20+
description: 'The account ID of the App Mesh Mesh.'
21+
required: false
22+
tags:
23+
description: 'An array of objects with the keywords "key" and "value", as a JSON string, ex: [{"key": "foo", "value": "bar"}]'
24+
required: false
25+
outputs:
26+
arn:
27+
description: 'The ARN of the Virtual Node'
28+
response:
29+
description: 'The final response of the AWS API.'
30+
runs:
31+
using: 'node12'
32+
main: 'dist/index.js'

0 commit comments

Comments
 (0)