Compare commits

...

4 Commits

Author SHA1 Message Date
Volodymyr Zotov
9fd72bcae7 Point to the feature branch to run tests 2025-08-14 11:43:38 -05:00
Volodymyr Zotov
4c8b833188 Make latest build 2025-08-14 11:40:05 -05:00
Volodymyr Zotov
b10aa9ed81 Fix tests 2025-08-14 11:39:57 -05:00
Volodymyr Zotov
b9110a4b5b Rename version input to cli-version 2025-08-14 10:58:58 -05:00
5 changed files with 21 additions and 15 deletions

View File

@@ -15,7 +15,7 @@ on:
export-env:
required: true
type: boolean
version:
cli-version:
required: false
type: string
default: "latest"
@@ -90,7 +90,7 @@ jobs:
id: load_secrets
uses: ./ # 1password/load-secrets-action@<version>
with:
version: ${{ inputs.version }}
cli-version: ${{ inputs.cli-version }}
export-env: ${{ inputs.export-env }}
env:
SECRET: ${{ inputs.secret }}

View File

@@ -22,12 +22,12 @@ jobs:
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
)
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@vzt/rename-version-input # TODO: temporary point to this branch so tests can run with update input
secrets: inherit
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
cli-version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
auth: [connect, service-account]
exclude:
- os: macos-latest
@@ -36,7 +36,7 @@ jobs:
auth: connect
with:
os: ${{ matrix.os }}
version: ${{ matrix.version }}
cli-version: ${{ matrix.cli-version }}
auth: ${{ matrix.auth }}
secret: op://acceptance-tests/test-secret/password
secret-in-section: op://acceptance-tests/test-secret/test-section/password
@@ -50,12 +50,12 @@ jobs:
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
)
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@vzt/rename-version-input # TODO: temporary point to this branch so tests can run with update input
secrets: inherit
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
cli-version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
auth: [connect, service-account]
exclude:
- os: macos-latest
@@ -64,7 +64,7 @@ jobs:
auth: connect
with:
os: ${{ matrix.os }}
version: ${{ matrix.version }}
cli-version: ${{ matrix.cli-version }}
auth: ${{ matrix.auth }}
secret: op://acceptance-tests/test-secret/password
secret-in-section: op://acceptance-tests/test-secret/test-section/password
@@ -78,12 +78,12 @@ jobs:
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
)
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@vzt/rename-version-input # TODO: temporary point to this branch so tests can run with update input
secrets: inherit
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
cli-version: [latest, latest-beta, 2.30.0, 2.30.0-beta.03]
auth: [connect, service-account]
exclude:
- os: macos-latest
@@ -92,7 +92,7 @@ jobs:
auth: connect
with:
os: ${{ matrix.os }}
version: ${{ matrix.version }}
cli-version: ${{ matrix.cli-version }}
auth: ${{ matrix.auth }}
secret: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/password
secret-in-section: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/Section_tco6nsqycj6jcbyx63h5isxcny/doxu3mhkozcznnk5vjrkpdqayy

View File

@@ -11,7 +11,7 @@ inputs:
export-env:
description: Export the secrets as environment variables
default: "false"
version:
cli-version:
description: Specify which 1Password CLI version to install. Defaults to "latest".
default: "latest"
runs:

8
dist/index.js vendored
View File

@@ -34870,7 +34870,9 @@ const version_1 = __nccwpck_require__(8950);
const cli_installer_1 = __nccwpck_require__(2846);
// Installs the 1Password CLI on a GitHub Action runner.
const installCliOnGithubActionRunner = async (version) => {
const versionResolver = new version_1.VersionResolver(version ?? core.getInput("version"));
// Get the version from parameter, if not passed - from the job input. Defaults to latest if no version is provided
const providedVersion = version || core.getInput("version") || version_1.ReleaseChannel.latest;
const versionResolver = new version_1.VersionResolver(providedVersion);
await versionResolver.resolve();
const installer = (0, cli_installer_1.newCliInstaller)(versionResolver.get());
await installer.installCli();
@@ -35284,7 +35286,9 @@ const installCLI = async () => {
// If there's no CLI installed, then validateCli will throw an error, which we will use
// as an indicator that we need to execute the installation script.
await (0,dist.validateCli)().catch(async () => {
await (0,op_cli_installer_dist/* installCliOnGithubActionRunner */.Cq)();
// defaults to `latest` if not provided
const cliVersion = core.getInput("cli-version");
await (0,op_cli_installer_dist/* installCliOnGithubActionRunner */.Cq)(cliVersion);
});
};
void loadSecretsAction();

View File

@@ -44,7 +44,9 @@ const installCLI = async (): Promise<void> => {
// If there's no CLI installed, then validateCli will throw an error, which we will use
// as an indicator that we need to execute the installation script.
await validateCli().catch(async () => {
await installCliOnGithubActionRunner();
// defaults to `latest` if not provided
const cliVersion = core.getInput("cli-version");
await installCliOnGithubActionRunner(cliVersion);
});
};