Skip to content

Commit d37694f

Browse files
committed
fix: Add release build
1 parent fee9f58 commit d37694f

File tree

3 files changed

+67
-17
lines changed

3 files changed

+67
-17
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ defaults:
88
run:
99
working-directory: admin-support-cli
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
1215
test:
1316
name: Run tests
@@ -28,3 +31,19 @@ jobs:
2831
- run: npm run build --if-present
2932

3033
- run: npm run test --if-present
34+
35+
- name: Update dist
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
gh pr checkout ${{ github.event.pull_request.number }}
40+
git config --global user.name "action-bot"
41+
git config --global user.email "[email protected]"
42+
DIFF=$(git diff-index HEAD dist/)
43+
if [ "$DIFF" ]
44+
then
45+
git commit -m "chore: Update action dist" dist/index.js
46+
git push
47+
else
48+
echo "Distribution is up-to-date."
49+
fi

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Get app installation token
12+
uses: npalm/[email protected]
13+
id: token
14+
with:
15+
appId: ${{ secrets.APP_ID }}
16+
appPrivateKeyBase64: ${{ secrets.APP_PRIVATE_KEY_BASE64 }}
17+
appInstallationType: repo
18+
appInstallationValue: ${{ github.repository }}
19+
20+
- name: Release
21+
uses: google-github-actions/release-please-action@v3
22+
with:
23+
release-type: simple
24+
token: ${{ steps.token.outputs.token }}

admin-support-cli/dist/index.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,9 @@ exports.context = new Context.Context();
10751075
* @param token the repo PAT or GITHUB_TOKEN
10761076
* @param options other options to set
10771077
*/
1078-
function getOctokit(token, options) {
1079-
return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));
1078+
function getOctokit(token, options, ...additionalPlugins) {
1079+
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
1080+
return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options));
10801081
}
10811082
exports.getOctokit = getOctokit;
10821083
//# sourceMappingURL=github.js.map
@@ -1158,7 +1159,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
11581159
return result;
11591160
};
11601161
Object.defineProperty(exports, "__esModule", ({ value: true }));
1161-
exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
1162+
exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
11621163
const Context = __importStar(__nccwpck_require__(4087));
11631164
const Utils = __importStar(__nccwpck_require__(7914));
11641165
// octokit + plugins
@@ -1167,13 +1168,13 @@ const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
11671168
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
11681169
exports.context = new Context.Context();
11691170
const baseUrl = Utils.getApiBaseUrl();
1170-
const defaults = {
1171+
exports.defaults = {
11711172
baseUrl,
11721173
request: {
11731174
agent: Utils.getProxyAgent(baseUrl)
11741175
}
11751176
};
1176-
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);
1177+
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
11771178
/**
11781179
* Convience function to correctly format Octokit Options to pass into the constructor.
11791180
*
@@ -5794,7 +5795,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
57945795

57955796
var BottleneckLight = _interopDefault(__nccwpck_require__(1174));
57965797

5797-
const VERSION = "4.2.0";
5798+
const VERSION = "4.3.0";
57985799

57995800
const noop = () => Promise.resolve(); // @ts-expect-error
58005801

@@ -16369,7 +16370,7 @@ function composeNode(ctx, token, props, onError) {
1636916370
node.srcToken = token;
1637016371
return node;
1637116372
}
16372-
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag }, onError) {
16373+
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
1637316374
const token = {
1637416375
type: 'scalar',
1637516376
offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
@@ -16384,8 +16385,10 @@ function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anch
1638416385
}
1638516386
if (spaceBefore)
1638616387
node.spaceBefore = true;
16387-
if (comment)
16388+
if (comment) {
1638816389
node.comment = comment;
16390+
node.range[2] = end;
16391+
}
1638916392
return node;
1639016393
}
1639116394
function composeAlias({ options }, { offset, source, end }, onError) {
@@ -16746,6 +16749,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
1674616749
if (ctx.atRoot)
1674716750
ctx.atRoot = false;
1674816751
let offset = bm.offset;
16752+
let commentEnd = null;
1674916753
for (const collItem of bm.items) {
1675016754
const { start, key, sep, value } = collItem;
1675116755
// key properties
@@ -16765,7 +16769,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
1676516769
onError(offset, 'BAD_INDENT', startColMsg);
1676616770
}
1676716771
if (!keyProps.anchor && !keyProps.tag && !sep) {
16768-
// TODO: assert being at last item?
16772+
commentEnd = keyProps.end;
1676916773
if (keyProps.comment) {
1677016774
if (map.comment)
1677116775
map.comment += '\n' + keyProps.comment;
@@ -16835,7 +16839,9 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
1683516839
map.items.push(pair);
1683616840
}
1683716841
}
16838-
map.range = [bm.offset, offset, offset];
16842+
if (commentEnd && commentEnd < offset)
16843+
onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
16844+
map.range = [bm.offset, offset, commentEnd ?? offset];
1683916845
return map;
1684016846
}
1684116847

@@ -17063,6 +17069,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
1706317069
if (ctx.atRoot)
1706417070
ctx.atRoot = false;
1706517071
let offset = bs.offset;
17072+
let commentEnd = null;
1706617073
for (const { start, value } of bs.items) {
1706717074
const props = resolveProps.resolveProps(start, {
1706817075
indicator: 'seq-item-ind',
@@ -17071,30 +17078,29 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
1707117078
onError,
1707217079
startOnNewline: true
1707317080
});
17074-
offset = props.end;
1707517081
if (!props.found) {
1707617082
if (props.anchor || props.tag || value) {
1707717083
if (value && value.type === 'block-seq')
17078-
onError(offset, 'BAD_INDENT', 'All sequence items must start at the same column');
17084+
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
1707917085
else
1708017086
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
1708117087
}
1708217088
else {
17083-
// TODO: assert being at last item?
17089+
commentEnd = props.end;
1708417090
if (props.comment)
1708517091
seq.comment = props.comment;
1708617092
continue;
1708717093
}
1708817094
}
1708917095
const node = value
1709017096
? composeNode(ctx, value, props, onError)
17091-
: composeEmptyNode(ctx, offset, start, null, props, onError);
17097+
: composeEmptyNode(ctx, props.end, start, null, props, onError);
1709217098
if (ctx.schema.compat)
1709317099
utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
1709417100
offset = node.range[2];
1709517101
seq.items.push(node);
1709617102
}
17097-
seq.range = [bs.offset, offset, offset];
17103+
seq.range = [bs.offset, offset, commentEnd ?? offset];
1709817104
return seq;
1709917105
}
1710017106

@@ -18395,7 +18401,7 @@ function createNode(value, tagName, ctx) {
1839518401
if (value instanceof String ||
1839618402
value instanceof Number ||
1839718403
value instanceof Boolean ||
18398-
(typeof BigInt === 'function' && value instanceof BigInt) // not supported everywhere
18404+
(typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere
1839918405
) {
1840018406
// https://tc39.es/ecma262/#sec-serializejsonproperty
1840118407
value = value.valueOf();
@@ -22978,7 +22984,8 @@ class YAMLSet extends YAMLMap.YAMLMap {
2297822984
let pair;
2297922985
if (Node.isPair(key))
2298022986
pair = key;
22981-
else if (typeof key === 'object' &&
22987+
else if (key &&
22988+
typeof key === 'object' &&
2298222989
'key' in key &&
2298322990
'value' in key &&
2298422991
key.value === null)

0 commit comments

Comments
 (0)