@argos-ci/gitlab 0.4.4 → 0.5.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -10,10 +10,21 @@ import { Gitlab } from "@gitbeaker/rest";
10
10
  */
11
11
  async function run(input) {
12
12
  const { argosClient, gitlabClient, gitlabProjectId, pullInterval, commit } = input;
13
- const { data, error } = await argosClient.GET("/project/builds", { params: { query: {
14
- distinctName: "true",
15
- commit
16
- } } });
13
+ const { data: project, error: projectError } = await argosClient.GET("/project");
14
+ if (projectError) {
15
+ console.error(projectError);
16
+ throw new Error(projectError.error);
17
+ }
18
+ const { data, error } = await argosClient.GET("/projects/{owner}/{project}/builds", { params: {
19
+ path: {
20
+ owner: project.account.slug,
21
+ project: project.name
22
+ },
23
+ query: {
24
+ distinctName: "true",
25
+ headSha: commit
26
+ }
27
+ } });
17
28
  if (error) {
18
29
  console.error(error);
19
30
  throw new Error(error.error);
package/dist/index.mjs CHANGED
@@ -6,10 +6,21 @@ import { Gitlab } from "@gitbeaker/rest";
6
6
  */
7
7
  async function run(input) {
8
8
  const { argosClient, gitlabClient, gitlabProjectId, pullInterval, commit } = input;
9
- const { data, error } = await argosClient.GET("/project/builds", { params: { query: {
10
- distinctName: "true",
11
- commit
12
- } } });
9
+ const { data: project, error: projectError } = await argosClient.GET("/project");
10
+ if (projectError) {
11
+ console.error(projectError);
12
+ throw new Error(projectError.error);
13
+ }
14
+ const { data, error } = await argosClient.GET("/projects/{owner}/{project}/builds", { params: {
15
+ path: {
16
+ owner: project.account.slug,
17
+ project: project.name
18
+ },
19
+ query: {
20
+ distinctName: "true",
21
+ headSha: commit
22
+ }
23
+ } });
13
24
  if (error) {
14
25
  console.error(error);
15
26
  throw new Error(error.error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/gitlab",
3
3
  "description": "GitLab utilities for visual testing with Argos.",
4
- "version": "0.4.4",
4
+ "version": "0.5.1-alpha.2+3431e7d",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -47,12 +47,12 @@
47
47
  "lint": "eslint ."
48
48
  },
49
49
  "dependencies": {
50
- "@argos-ci/api-client": "0.16.1",
50
+ "@argos-ci/api-client": "0.17.1-alpha.2+3431e7d",
51
51
  "@gitbeaker/rest": "^43.8.0",
52
52
  "commander": "^14.0.3"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "catalog:"
56
56
  },
57
- "gitHead": "b49d186d5eb6e1338982a4cd5c3cb29e6cb0b7af"
57
+ "gitHead": "3431e7d43acf6b1f043b55e53dec32318cabcd4c"
58
58
  }