Skip to content

Commit a0da25d

Browse files
committed
resolve lint warns
1 parent 2ca4358 commit a0da25d

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ Can be a [glob](https://github.com/isaacs/node-glob#glob-primer) or and `Array`
103103
[globs](https://github.com/isaacs/node-glob#glob-primer) and `Object`s with the following properties:
104104

105105
| Property | Description | Default |
106-
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
106+
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
107107
| `path` | **Required**, unless `url` is set. A [glob](https://github.com/isaacs/node-glob#glob-primer) to identify the files to upload. Supports [Lodash templating](https://lodash.com/docs#template). | - |
108108
| `url` | Alternative to setting `path` this provides the ability to add links to releases, e.g. URLs to container images. Supports [Lodash templating](https://lodash.com/docs#template). | - |
109109
| `label` | Short description of the file displayed on the GitLab release. Ignored if `path` matches more than one file. Supports [Lodash templating](https://lodash.com/docs#template). | File name extracted from the `path`. |
110110
| `type` | Asset type displayed on the GitLab release. Can be `runbook`, `package`, `image` and `other` (see official documents on [release assets](https://docs.gitlab.com/ee/user/project/releases/#release-assets)). Supports [Lodash templating](https://lodash.com/docs#template). | `other` |
111111
| `filepath` | A filepath for creating a permalink pointing to the asset (requires GitLab 12.9+, see official documents on [permanent links](https://docs.gitlab.com/ee/user/project/releases/#permanent-links-to-release-assets)). Ignored if `path` matches more than one file. Supports [Lodash templating](https://lodash.com/docs#template). | - |
112112
| `target` | Controls where the file is uploaded to. Can be set to `project_upload` for storing the file as [project upload](https://docs.gitlab.com/ee/api/projects.html#upload-a-file) or `generic_package` for storing the file as [generic package](https://docs.gitlab.com/ee/user/packages/generic_packages/). | `project_upload` |
113-
| `packageName` | This is only applied if `target` is set to `generic_package`. It defines the package name (`:package_name`) to upload asset file to. More information could be found at [Publish a package](https://docs.gitlab.com/user/packages/generic_packages/#publish-a-package) | `release` |
113+
| `packageName` | This is only applied if `target` is set to `generic_package`. It defines the package name (`:package_name`) to upload asset file to. More information could be found at [Publish a package](https://docs.gitlab.com/user/packages/generic_packages/#publish-a-package) | `release` |
114114
| `status` | This is only applied, if `target` is set to `generic_package`. The generic package status. Can be `default` and `hidden` (see official documents on [generic packages](https://docs.gitlab.com/ee/user/packages/generic_packages/)). | `default` |
115115

116116
Each entry in the `assets` `Array` is globbed individually. A [glob](https://github.com/isaacs/node-glob#glob-primer)

lib/publish.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export default async (pluginConfig, context) => {
105105
debug("file status: %o", status);
106106
debug("package name: %o", packageName);
107107

108-
109108
let uploadEndpoint;
110109
let response;
111110

test/publish.test.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ test.serial("Publish a release with generics: with asset.packageName (fixed text
187187
const encodedGitTag = encodeURIComponent(nextRelease.gitTag);
188188
const encodedVersion = encodeURIComponent(nextRelease.version);
189189
const uploaded = { file: { url: "/uploads/file.css" } };
190-
const generic = { path: "file.css", label: "Style package", target: "generic_package", status: "hidden", packageName: "microk8s" };
190+
const generic = {
191+
path: "file.css",
192+
label: "Style package",
193+
target: "generic_package",
194+
status: "hidden",
195+
packageName: "microk8s",
196+
};
191197
const assets = [generic];
192198
const encodedLabel = encodeURIComponent(generic.label);
193199
const encodedPackageName = encodeURIComponent(generic.packageName);
@@ -228,13 +234,25 @@ test.serial("Publish a release with generics: with asset.packageName (template)"
228234
const owner = "test_user";
229235
const repo = "test_repo";
230236
const env = { GITLAB_TOKEN: "gitlab_token" };
231-
const nextRelease = { gitHead: "123", gitTag: "v1.0.0-alpha.1", notes: "Test release note body", version: "1.0.0-alpha.1", channel: "alpha"};
237+
const nextRelease = {
238+
gitHead: "123",
239+
gitTag: "v1.0.0-alpha.1",
240+
notes: "Test release note body",
241+
version: "1.0.0-alpha.1",
242+
channel: "alpha",
243+
};
232244
const options = { repositoryUrl: `https://gitlab.com/${owner}/${repo}.git` };
233245
const encodedProjectPath = encodeURIComponent(`${owner}/${repo}`);
234246
const encodedGitTag = encodeURIComponent(nextRelease.gitTag);
235247
const encodedVersion = encodeURIComponent(nextRelease.version);
236248
const uploaded = { file: { url: "/uploads/file.css" } };
237-
const generic = { path: "file.css", label: "Style package", target: "generic_package", status: "hidden", packageName: "${nextRelease.channel}" };
249+
const generic = {
250+
path: "file.css",
251+
label: "Style package",
252+
target: "generic_package",
253+
status: "hidden",
254+
packageName: "${nextRelease.channel}",
255+
};
238256
const assets = [generic];
239257
const encodedLabel = encodeURIComponent(generic.label);
240258
const expectedUrl = `https://gitlab.com/api/v4/projects/${encodedProjectPath}/packages/generic/alpha/${encodedVersion}/${encodedLabel}`;

0 commit comments

Comments
 (0)