Skip to content

Commit

Permalink
ci: allow api version on registry update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 27, 2024
1 parent a33a183 commit 376a699
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contributing/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The script will:
yarn update-registry YourTypeNameHere
```

You can set the environment variable `SF_ORG_API_VERSION` if you want to specify an API version.

### What the script can't do

inFolderTypes and types with childXml in their describe are not supported. You **want** to explore the various strategies for those (see the [SDR Handbook](../HANDBOOK.md) in this repo) and [create tests](#integration-testing) to validate that your types are being handled correctly.
Expand Down
3 changes: 2 additions & 1 deletion scripts/update-registry/update2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as deepmerge from 'deepmerge';
import { CoverageObject, CoverageObjectType } from '../../src/registry/types';
import { getMissingTypes } from '../../test/utils/getMissingTypes';
import { getCurrentApiVersion, getCoverage } from '../../src/registry/coverage';
import { env } from '@salesforce/kit';

export let metadataCoverage: CoverageObject;

Expand Down Expand Up @@ -83,7 +84,7 @@ const registryUpdate = (missingTypesAsDescribeResult: DescribeResult[]) => {

// get the coverage report
(async () => {
const currentApiVersion = await getCurrentApiVersion();
const currentApiVersion = env.getNumber('SF_ORG_API_VERSION') ?? (await getCurrentApiVersion());
console.log(`Using API version: ${currentApiVersion}`);

const metadataCoverage = await getCoverage(currentApiVersion);
Expand Down

0 comments on commit 376a699

Please sign in to comment.