env-secrets 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ # -*- mode: yaml -*-
2
+ # This example configuration for provides basic automations to get started with gitStream.
3
+ # View the gitStream quickstart for more examples: https://docs.gitstream.cm/quick-start/
4
+ manifest:
5
+ version: 1.0
6
+ automations:
7
+ # Add a label that indicates how many minutes it will take to review the PR.
8
+ estimated_time_to_review:
9
+ if:
10
+ - true
11
+ run:
12
+ - action: add-label@v1
13
+ # etr is defined in the last section of this example
14
+ args:
15
+ label: "{{ calc.etr }} min review"
16
+ color: {{ 'E94637' if (calc.etr >= 20) else ('FBBD10' if (calc.etr >= 5) else '36A853') }}
17
+ # Post a comment that lists the best experts for the files that were modified.
18
+ code_experts:
19
+ if:
20
+ - true
21
+ run:
22
+ - action: add-comment@v1
23
+ # More info about explainCodeExperts: https://docs.gitstream.cm/filter-functions/#explaincodeexperts
24
+ args:
25
+ comment: |
26
+ {{ repo | explainCodeExperts(gt=10) }}
27
+ # approve changes to docs, formatting, tests or assets
28
+ safe_changes:
29
+ if:
30
+ - {{ is.docs or is.tests or is.asset or is.formatting }}
31
+ run:
32
+ - action: add-label@v1
33
+ args:
34
+ label: 'safe-changes'
35
+ - action: approve@v1
36
+ # approve dependabot
37
+ dependabot:
38
+ if:
39
+ - {{ branch.name | includes(term="dependabot") }}
40
+ - {{ branch.author | includes(term="dependabot") }}
41
+ run:
42
+ - action: approve@v1
43
+ - action: add-label@v1
44
+ args:
45
+ label: "approved-dependabot"
46
+ - action: merge@v1
47
+ args:
48
+ wait_for_all_checks: true
49
+ squash_on_merge: true
50
+ # The next function calculates the estimated time to review and makes it available in the automation above.
51
+ calc:
52
+ etr: {{ branch | estimatedReviewTime }}
53
+ is:
54
+ docs: {{ files | allDocs }}
55
+ tests: {{ files | allTests }}
56
+ asset: {{ files | match(regex=r/\.(png|svg|gif|css)$/) | every }}
57
+ formatting: {{ source.diff.files | isFormattingChange }}
@@ -4,7 +4,7 @@ updates:
4
4
  versioning-strategy: increase
5
5
  directory: '/'
6
6
  schedule:
7
- interval: 'monthly'
7
+ interval: 'weekly'
8
8
  labels:
9
9
  - 'dependencies'
10
10
  open-pull-requests-limit: 100
@@ -14,3 +14,14 @@ updates:
14
14
  - dependency-name: 'fs-extra'
15
15
  - dependency-name: '*'
16
16
  update-types: ['version-update:semver-major']
17
+
18
+ # Maintain dependencies for GitHub Actions
19
+ - package-ecosystem: 'github-actions'
20
+ directory: '/'
21
+ schedule:
22
+ interval: 'weekly'
23
+ pull-request-branch-name:
24
+ separator: '-'
25
+ labels:
26
+ - 'github-actions'
27
+ - 'dependencies'
@@ -10,14 +10,14 @@ jobs:
10
10
  build:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  with:
15
15
  fetch-depth: 0
16
16
 
17
17
  - name: Set up Node.js
18
- uses: actions/setup-node@v3
18
+ uses: actions/setup-node@v4
19
19
  with:
20
- node-version: 18.14.0
20
+ node-version: 20.18.3
21
21
 
22
22
  - name: Install Node.js dependencies
23
23
  run: yarn
@@ -0,0 +1,49 @@
1
+ # Code generated by gitStream GitHub app - DO NOT EDIT
2
+
3
+ name: gitStream workflow automation
4
+ run-name: |
5
+ /:\ gitStream: PR #${{ fromJSON(fromJSON(github.event.inputs.client_payload)).pullRequestNumber }} from ${{ github.event.inputs.full_repository }}
6
+
7
+ on:
8
+ workflow_dispatch:
9
+ inputs:
10
+ client_payload:
11
+ description: The Client payload
12
+ required: true
13
+ full_repository:
14
+ description: the repository name include the owner in `owner/repo_name` format
15
+ required: true
16
+ head_ref:
17
+ description: the head sha
18
+ required: true
19
+ base_ref:
20
+ description: the base ref
21
+ required: true
22
+ installation_id:
23
+ description: the installation id
24
+ required: false
25
+ resolver_url:
26
+ description: the resolver url to pass results to
27
+ required: true
28
+ resolver_token:
29
+ description: Optional resolver token for resolver service
30
+ required: false
31
+ default: ''
32
+
33
+ jobs:
34
+ gitStream:
35
+ timeout-minutes: 5
36
+ runs-on: ubuntu-latest
37
+ name: gitStream workflow automation
38
+ steps:
39
+ - name: Evaluate Rules
40
+ uses: linear-b/gitstream-github-action@v2
41
+ id: rules-engine
42
+ with:
43
+ full_repository: ${{ github.event.inputs.full_repository }}
44
+ head_ref: ${{ github.event.inputs.head_ref }}
45
+ base_ref: ${{ github.event.inputs.base_ref }}
46
+ client_payload: ${{ github.event.inputs.client_payload }}
47
+ installation_id: ${{ github.event.inputs.installation_id }}
48
+ resolver_url: ${{ github.event.inputs.resolver_url }}
49
+ resolver_token: ${{ github.event.inputs.resolver_token }}
@@ -12,19 +12,19 @@ jobs:
12
12
 
13
13
  steps:
14
14
  - name: Check out Git repository
15
- uses: actions/checkout@v3
15
+ uses: actions/checkout@v4
16
16
 
17
17
  - name: Set up Node.js
18
- uses: actions/setup-node@v3
18
+ uses: actions/setup-node@v4
19
19
  with:
20
- node-version: 18.14.2
20
+ node-version: 20.18.3
21
21
 
22
22
  # ESLint and Prettier must be in `package.json`
23
23
  - name: Install Node.js dependencies
24
24
  run: yarn --frozen-lockfile
25
25
 
26
26
  - name: Run linters
27
- uses: wearerequired/lint-action@v1
27
+ uses: wearerequired/lint-action@v2
28
28
  with:
29
29
  eslint: true
30
30
  eslint_extensions: js,ts
@@ -4,6 +4,10 @@ name: Release and Publish
4
4
  on:
5
5
  workflow_dispatch:
6
6
 
7
+ permissions:
8
+ contents: write
9
+ packages: read
10
+
7
11
  jobs:
8
12
  release:
9
13
  if: ${{ github.ref == 'refs/heads/main' }}
@@ -11,7 +15,7 @@ jobs:
11
15
  runs-on: ubuntu-latest
12
16
  steps:
13
17
  - name: Clone Repository
14
- uses: actions/checkout@v3
18
+ uses: actions/checkout@v4
15
19
  with:
16
20
  fetch-depth: 0
17
21
 
@@ -21,9 +25,9 @@ jobs:
21
25
  git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
22
26
 
23
27
  - name: Set up Node.js
24
- uses: actions/setup-node@v3
28
+ uses: actions/setup-node@v4
25
29
  with:
26
- node-version: 18.14.0
30
+ node-version: 20.18.3
27
31
  registry-url: 'https://registry.npmjs.org'
28
32
 
29
33
  - name: Install Node.js dependencies
@@ -1,27 +1,24 @@
1
1
  name: Synk analysis
2
2
 
3
- on: push
3
+ on:
4
+ pull_request_target:
5
+ push:
6
+ branches:
7
+ - main
4
8
 
5
9
  jobs:
6
10
  security:
7
11
  runs-on: ubuntu-latest
8
12
  steps:
9
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
10
14
  - name: Run Snyk to check for vulnerabilities
11
15
  uses: snyk/actions/node@master
16
+ continue-on-error: true # To make sure that SARIF upload gets called
12
17
  env:
13
18
  SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
14
- - name: Notify failures
15
- if: failure()
16
- uses: rtCamp/action-slack-notify@v2
17
- env:
18
- SLACK_LINK_NAMES: true
19
- SLACK_MESSAGE:
20
- # prettier-ignore
21
- "hey @${{ github.actor }}, @mark, sorry to let you know you broke the build"
22
- SLACK_CHANNEL: feed-github
23
- SLACK_COLOR: ${{ job.status }}
24
- SLACK_ICON: https://avatars.githubusercontent.com/u/82425418?s=200&v=4
25
- SLACK_TITLE: 'Failed: env-secrets to dev :fire:'
26
- SLACK_USERNAME: env-secrets-bot
27
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
19
+ with:
20
+ args: --sarif-file-output=snyk.sarif
21
+ - name: Upload result to GitHub Code Scanning
22
+ uses: github/codeql-action/upload-sarif@v3
23
+ with:
24
+ sarif_file: snyk.sarif
@@ -14,14 +14,14 @@ jobs:
14
14
 
15
15
  strategy:
16
16
  matrix:
17
- node-version: [14.x, 16.x, 18.x]
17
+ node-version: [16.x, 18.x, 20.x]
18
18
 
19
19
  steps:
20
20
  - name: Checkout repository
21
- uses: actions/checkout@v2
21
+ uses: actions/checkout@v4
22
22
 
23
23
  - name: Set up Node.js ${{ matrix.node-version }}
24
- uses: actions/setup-node@v3
24
+ uses: actions/setup-node@v4
25
25
  with:
26
26
  node-version: ${{ matrix.node-version }}
27
27
 
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- v18.14.2
1
+ v20.18.3
package/README.md CHANGED
@@ -49,10 +49,6 @@ env-secrets aws -s <secret name> -r <region> -p <profile> -- <program to run>
49
49
 
50
50
  example:
51
51
 
52
- ```
53
- env-secrets aws -s local/sample -r us-east-1 -p marka -- env
54
- ```
55
-
56
52
  Create a Secret using AWS cli
57
53
 
58
54
  ```
@@ -64,9 +60,23 @@ aws secretsmanager create-secret \
64
60
  --secret-string "{\"user\":\"marka\",\"password\":\"mypassword\"}"
65
61
  ```
66
62
 
63
+ List the secret using AWS cli
64
+
65
+ ```
66
+ aws secretsmanager get-secret-value \
67
+ --region us-east-1 \
68
+ --profile marka \
69
+ --secret-id local/sample \
70
+ --query SecretString
71
+ ```
72
+
73
+ ```
74
+ env-secrets aws -s local/sample -r us-east-1 -p marka -- echo \${user}/\${password}
75
+ ```
76
+
67
77
  ## Development
68
78
 
69
- Setup node using [nvm](https://github.com/nvm-sh/nvm). Or use node 18.x.
79
+ Setup node using [nvm](https://github.com/nvm-sh/nvm). Or use node 20 (LTS).
70
80
 
71
81
  ```
72
82
  nvm use
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "env-secrets",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "get secrets from a secrets vault and inject them into the running environment",
5
5
  "main": "index.js",
6
6
  "author": "Mark C Allen (@markcallen)",
@@ -19,28 +19,28 @@
19
19
  "test": "jest"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/debug": "^4.1.7",
23
- "@types/jest": "^29.4.0",
24
- "@types/node": "^18.15.11",
25
- "@typescript-eslint/eslint-plugin": "^5.57.1",
26
- "@typescript-eslint/parser": "^5.57.0",
27
- "eslint": "^8.37.0",
28
- "eslint-config-prettier": "^8.8.0",
22
+ "@types/debug": "^4.1.12",
23
+ "@types/jest": "^29.5.14",
24
+ "@types/node": "^18.19.80",
25
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
26
+ "@typescript-eslint/parser": "^5.62.0",
27
+ "eslint": "^8.57.1",
28
+ "eslint-config-prettier": "^8.10.0",
29
29
  "eslint-plugin-prettier": "^4.2.1",
30
30
  "husky": "^8.0.3",
31
- "jest": "^29.5.0",
32
- "lint-staged": "^13.2.0",
33
- "prettier": "^2.8.7",
34
- "release-it": "^15.10.1",
31
+ "jest": "^29.7.0",
32
+ "lint-staged": "13.3.0",
33
+ "prettier": "^2.8.8",
34
+ "release-it": "^15.11.0",
35
35
  "rimraf": "^3.0.2",
36
- "ts-jest": "^29.0.5",
37
- "ts-node": "^10.9.1",
36
+ "ts-jest": "^29.2.6",
37
+ "ts-node": "^10.9.2",
38
38
  "typescript": "^4.9.5"
39
39
  },
40
40
  "dependencies": {
41
- "aws-sdk": "^2.1351.0",
41
+ "aws-sdk": "^2.1692.0",
42
42
  "commander": "^9.5.0",
43
- "debug": "^4.3.4"
43
+ "debug": "^4.4.0"
44
44
  },
45
45
  "lint-staged": {
46
46
  "*.{ts,js}": [
@@ -56,5 +56,8 @@
56
56
  },
57
57
  "bin": {
58
58
  "env-secrets": "./dist/index.js"
59
+ },
60
+ "engines": {
61
+ "node": "^16.14.0 || >=18.0.0"
59
62
  }
60
63
  }