Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate action to Typescript #36

Merged
merged 47 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
94471ca
Make function for executing script
edif2008 Apr 10, 2023
c7236d5
Migrate auth validation
edif2008 Apr 10, 2023
6c9a28c
Migrate load secret functionality
edif2008 Apr 10, 2023
c8ce875
Fix CLI installation process
edif2008 Apr 10, 2023
1cf5241
Fix conditional of appending protocol
edif2008 Apr 10, 2023
98fac4e
Improve code
edif2008 Apr 10, 2023
4d1bf78
Update CLI version and improve script
edif2008 Apr 10, 2023
ade7b48
Use core.addPath
edif2008 Apr 10, 2023
cdeff7c
Use version from package.json
edif2008 Apr 10, 2023
01b4970
Update dependencies
edif2008 Apr 10, 2023
e25f48a
Upgrade to Typescript 5
edif2008 Apr 11, 2023
c625e2e
Merge branch 'main' into eddy/migrate-action-ts
edif2008 Apr 11, 2023
e6d1e6d
Prettify test.yml
edif2008 Apr 11, 2023
e57ec50
Move constants to constants.ts
edif2008 Apr 11, 2023
06d0dba
Move 'validateAuth' to 'utils.ts'
edif2008 Apr 11, 2023
6e0c1c6
Add validate auth tests
edif2008 Apr 11, 2023
208d260
Extract functionality for extracting a secret
edif2008 Apr 11, 2023
33c5cc6
Add tests for extracting secret
edif2008 Apr 11, 2023
aeb83b5
Move 'unsetPrevious' to 'utils.ts'
edif2008 Apr 11, 2023
5d5973b
Add unit test pipeline
edif2008 Apr 11, 2023
1db0fc1
Add tests for 'unsetPrevious'
edif2008 Apr 12, 2023
d16183d
Improve disabling eslint rules
edif2008 May 22, 2023
6ecd5ce
Improve code based on PR review feedback
edif2008 May 22, 2023
17a2a72
Improve CLI installation functionality
edif2008 May 22, 2023
7c957c5
Simplify extractSecret functionality
edif2008 May 22, 2023
1b4d231
Update dist/index.js
edif2008 May 22, 2023
1cbdee3
Fix CLI version
edif2008 May 22, 2023
e46d4d6
Update packages
edif2008 May 24, 2023
ad89fe7
Move loadSecrets function to utils.ts
edif2008 May 25, 2023
3963458
Improve code
edif2008 May 25, 2023
1dd370e
Simplify code related to mocking
edif2008 May 25, 2023
57ddba0
Update packages
edif2008 Jul 4, 2023
35650f8
Use semverToInt from op-js
edif2008 Jul 4, 2023
1b79bb1
Imporve CLI installation script
edif2008 Jul 4, 2023
3daee42
Change from debug messages to info
edif2008 Jul 6, 2023
8c1801e
use toHaveBeenCalled consistently in tests
edif2008 Jul 6, 2023
27cd56a
Add warning if both configs are provided
edif2008 Jul 6, 2023
2c980ca
Add comment about cli validation process
edif2008 Jul 6, 2023
f34a5d1
Merge `main` into `eddy/migrate-action-ts`
edif2008 Jul 6, 2023
22a24ec
Build index.js
edif2008 Jul 6, 2023
37781db
Merge branch 'main' into eddy/migrate-action-ts
edif2008 Jul 6, 2023
433acb3
Update packages
edif2008 Jul 6, 2023
6fea62b
test: assertions for loadSecrets function
dustin-ruetz Jul 6, 2023
62959c4
Improve loadSecrets function
edif2008 Jul 7, 2023
190efe7
Merge branch 'main' into eddy/migrate-action-ts
edif2008 Feb 19, 2024
54bdc9a
Update dependencies
edif2008 Feb 19, 2024
b6d91a5
Upgrade action to use Node20
edif2008 Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ on: push
name: Run acceptance tests

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
edif2008 marked this conversation as resolved.
Show resolved Hide resolved
- run: npm ci
- run: npm test

test-with-output-secrets:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
auth: [ connect, service-account ]
os: [ubuntu-latest, macos-latest]
auth: [connect, service-account]
exclude:
- os: macos-latest
auth: connect
Expand Down Expand Up @@ -49,8 +59,8 @@ jobs:
test-with-export-env:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
auth: [ connect, service-account ]
os: [ubuntu-latest, macos-latest]
auth: [connect, service-account]
exclude:
- os: macos-latest
auth: connect
Expand Down Expand Up @@ -93,8 +103,8 @@ jobs:
test-references-with-ids:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
auth: [ connect, service-account ]
os: [ubuntu-latest, macos-latest]
auth: [connect, service-account]
exclude:
- os: macos-latest
auth: connect
Expand Down
11 changes: 10 additions & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ const jestConfig = {
testEnvironment: "node",
testRegex: "(/__tests__/.*|(\\.|/)test)\\.ts",
transform: {
".ts": ["ts-jest"],
".ts": [
"ts-jest",
{
dustin-ruetz marked this conversation as resolved.
Show resolved Hide resolved
// Note: We shouldn't need to include `isolatedModules` here because it's a deprecated config option in TS 5,
// but setting it to `true` fixes the `ESM syntax is not allowed in a CommonJS module when
// 'verbatimModuleSyntax' is enabled` error that we're seeing when running our Jest tests.
isolatedModules: true,
useESM: true,
},
],
},
verbose: true,
};
Expand Down
134 changes: 127 additions & 7 deletions dist/index.js

Large diffs are not rendered by default.

146 changes: 0 additions & 146 deletions entrypoint.sh
dustin-ruetz marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

24 changes: 24 additions & 0 deletions install_cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e

# Install op-cli
install_op_cli() {
CLI_VERSION="v$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)"
OP_INSTALL_DIR="$(mktemp -d)"
if [[ ! -d "$OP_INSTALL_DIR" ]]; then
echo "Install dir $OP_INSTALL_DIR not found"
exit 1
fi
echo "::debug::OP_INSTALL_DIR: ${OP_INSTALL_DIR}"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_linux_amd64_$CLI_VERSION.zip"
unzip -od "$OP_INSTALL_DIR" op.zip && rm op.zip
elif [[ "$OSTYPE" == "darwin"* ]]; then
curl -sSfLo op.pkg "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_apple_universal_$CLI_VERSION.pkg"
pkgutil --expand op.pkg temp-pkg
tar -xvf temp-pkg/op.pkg/Payload -C "$OP_INSTALL_DIR"
rm -rf temp-pkg && rm op.pkg
fi
}

install_op_cli
Loading