Skip to content

Commit

Permalink
Merge pull request #4 from vrifytechnology/upstream-master
Browse files Browse the repository at this point in the history
fix: Sync with upstream master
  • Loading branch information
yuekui authored May 22, 2024
2 parents a8a7864 + d615675 commit 7ccd435
Show file tree
Hide file tree
Showing 14 changed files with 10,909 additions and 10,006 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,30 @@ name: Check
jobs:
check:
name: Run Unit Tests
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run tests
run: |
npm ci
npm test
conventional-commits:
name: Semantic Pull Request
runs-on: ubuntu-22.04
steps:
- name: validate
uses: actions/github-script@v7
with:
script: |
// See https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c#file-conventional-commit-regex-md
const regex = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)/g;
const pr = context.payload.pull_request;
const title = pr.title;
if (title.match(regex) == null) {
throw `PR title "${title}"" does not match conventional commits from https://www.conventionalcommits.org/en/v1.0.0/`
}
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 0 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
57 changes: 57 additions & 0 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Send Notifications to Slack
on:
pull_request:
types: [opened, reopened]
issues:
types: [opened]
issue_comment:
types: [created]

jobs:
issue-notifications:
name: Send Notifications
runs-on: ubuntu-latest

steps:
- name: Send notifications on Pull Request
if: ${{ github.event_name == 'pull_request'}}
id: slack_PR
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Pull Request",
"Notification URL":"${{ github.event.pull_request.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.pull_request.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send notification on new issues
if: ${{github.event_name == 'issues'}}
id: slack_issue
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Issue",
"Notification URL":"${{ github.event.issue.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.issue.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send notification on Issues and Pull Requests Comments
if: ${{github.event_name == 'issue_comment'}}
id: slack_issue_comment
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Issue comment",
"Notification URL":"${{ github.event.comment.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.issue_comment.issue.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
50 changes: 32 additions & 18 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
# When a pull request is opened/reopened or when the head branch of the pull request is updated.
on:
push:
branches:
- master
[pull_request]

name: Package

jobs:
check:
name: Package distribution file
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Package
run: |
npm ci
npm test
npm run package
- name: Commit
run: |
git config --global user.name "GitHub Actions"
git add dist/
git commit -m "chore: Update dist" || echo "No changes to commit"
git push origin HEAD:master
- name: Init a git repo
uses: actions/checkout@v4
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: 20
- name: Package
run: |
npm ci
npm test
npm run package
- name: Commit to PR
if: github.actor == 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "GitHub Actions"
git add dist/
git commit -m "chore: Update dist" || echo "No changes to commit"
git push
- name: Check git diff
if: github.actor != 'dependabot[bot]'
run: |
git diff --exit-code dist/index.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/

# Editors
.vscode
.idea

# Logs
logs
Expand Down
17 changes: 11 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
queue_rules:
- name: default
conditions:
# Conditions to get out of the queue (= merged)
- status-success=Run Unit Tests
- status-success=Semantic Pull Request

pull_request_rules:
- name: Automatically merge on CI success and review approval
conditions:
Expand All @@ -13,10 +20,9 @@ pull_request_rules:
- -closed
- author!=dependabot[bot]
actions:
merge:
queue:
method: squash
strict: smart
strict_method: merge
name: default

- name: Automatically approve and merge Dependabot PRs
conditions:
Expand All @@ -31,7 +37,6 @@ pull_request_rules:
actions:
review:
type: APPROVE
merge:
queue:
method: squash
strict: smart+fasttrack
strict_method: merge
name: default
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.3.0](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.2.0...v1.3.0) (2024-05-07)


### Features

* support command override ([#284](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/284)) ([9259793](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/925979370e7456028a520e0dad54854d027a3808))

## [1.2.0](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.1.3...v1.2.0) (2023-11-14)


### Features

* ability to configure log driver and log options ([#255](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/255)) ([c6f3dfb](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/c6f3dfbdd9990283e47c9e0cf46393ea13f1541b))
* support dockerLabels ([#274](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/274)) ([b9718e5](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/b9718e5f28bbcaeae2944140d52452f71601a622))


### Bug Fixes

* update ncc and minor workflow enhancements ([#269](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/269)) ([3e9a743](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/3e9a74317f3b8a55dc9b95b57a1cac50099ed343))

### [1.1.3](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.1.2...v1.1.3) (2023-01-17)

### [1.1.2](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.1.1...v1.1.2) (2022-10-21)

### [1.1.1](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.1.0...v1.1.1) (2022-01-18)


### Bug Fixes

* Strict Mode Deprecation ([#150](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/150)) ([1d693a5](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/1d693a567ca030686d891af532ada9b4d908f863))

## [1.1.0](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.24...v1.1.0) (2021-12-01)


### Features

* add environment-variables support ([#114](https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/114)) ([85f5e35](https://github.com/aws-actions/amazon-ecs-render-task-definition/commit/85f5e350c104582a36945a4b66abdd29b42123bf))

### [1.0.24](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.23...v1.0.24) (2021-08-24)

### [1.0.23](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.22...v1.0.23) (2021-07-06)

### [1.0.22](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.21...v1.0.22) (2021-06-01)

### [1.0.21](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.20...v1.0.21) (2021-05-10)

### [1.0.20](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.19...v1.0.20) (2021-03-02)

### [1.0.19](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.18...v1.0.19) (2021-02-02)

### [1.0.18](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.17...v1.0.18) (2021-01-19)

### [1.0.17](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.16...v1.0.17) (2020-11-11)

### [1.0.16](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.15...v1.0.16) (2020-10-29)

### [1.0.15](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.14...v1.0.15) (2020-10-05)

### [1.0.14](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.13...v1.0.14) (2020-08-25)

### [1.0.13](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.12...v1.0.13) (2020-08-11)

### [1.0.12](https://github.com/aws-actions/amazon-ecs-render-task-definition/compare/v1.0.11...v1.0.12) (2020-07-17)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ To insert the image URI `amazon/amazon-ecs-sample:latest` as the image for the `
task-definition: task-definition.json
container-name: web
image: amazon/amazon-ecs-sample:latest
environment-variables: "LOG_LEVEL=info"

- name: Deploy to Amazon ECS service
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
Expand All @@ -46,6 +47,9 @@ input of the second:
task-definition: task-definition.json
container-name: web
image: amazon/amazon-ecs-sample-1:latest
environment-variables: |
LOG_LEVEL=info
ENVIRONMENT=prod
- name: Modify Amazon ECS task definition with second container
id: render-app-container
Expand Down
20 changes: 19 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,27 @@ inputs:
env-list:
description: 'A list of variables to pull from the environment'
required: false
environment-variables:
description: 'Variables to add to the container. Each variable is of the form KEY=value, you can specify multiple variables with multi-line YAML strings.'
required: false
log-configuration-log-driver:
description: "Create/Override logDriver inside logConfiguration"
required: false
log-configuration-options:
description: "Create/Override options inside logConfiguration. Each variable is of the form key=value, you can specify multiple variables with multi-line YAML strings."
required: false
docker-labels:
description: "Create/Override options inside dockerLabels. Each variable is key=value, you can specify multiple variables with multi-line YAML."
required: false
command:
description: 'The command used by ECS to start the container image'
required: false
env-files:
description: 'S3 object arns to set env variables onto the container. You can specify multiple files with multi-line YAML strings.'
required: false
outputs:
task-definition:
description: 'The path to the rendered task definition file'
runs:
using: 'node12'
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit 7ccd435

Please sign in to comment.