@openqa/cli 2.1.1 → 2.1.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.
@@ -1036,6 +1036,16 @@ var GitListener = class extends EventEmitter {
1036
1036
  for (const commit of commits) {
1037
1037
  if (this.lastCommitSha && commit.sha === this.lastCommitSha) break;
1038
1038
  const isMerge = commit.parents && commit.parents.length > 1;
1039
+ let changedFiles;
1040
+ try {
1041
+ const { data: detail } = await this.octokit.repos.getCommit({
1042
+ owner: this.config.owner,
1043
+ repo: this.config.repo,
1044
+ ref: commit.sha
1045
+ });
1046
+ changedFiles = (detail.files ?? []).map((f) => f.filename);
1047
+ } catch {
1048
+ }
1039
1049
  const event = {
1040
1050
  type: isMerge ? "merge" : "push",
1041
1051
  provider: "github",
@@ -1043,7 +1053,8 @@ var GitListener = class extends EventEmitter {
1043
1053
  commit: commit.sha,
1044
1054
  author: commit.commit.author?.name || "unknown",
1045
1055
  message: commit.commit.message,
1046
- timestamp: new Date(commit.commit.author?.date || Date.now())
1056
+ timestamp: new Date(commit.commit.author?.date || Date.now()),
1057
+ changedFiles
1047
1058
  };
1048
1059
  this.emit("git-event", event);
1049
1060
  if (isMerge) {
@@ -1129,6 +1140,16 @@ var GitListener = class extends EventEmitter {
1129
1140
  for (const commit of commits) {
1130
1141
  if (this.lastCommitSha && commit.id === this.lastCommitSha) break;
1131
1142
  const isMerge = commit.parent_ids && commit.parent_ids.length > 1;
1143
+ let changedFiles;
1144
+ try {
1145
+ const diffRes = await fetch(
1146
+ `${baseUrl}/api/v4/projects/${projectPath}/repository/commits/${commit.id}/diff`,
1147
+ { headers }
1148
+ );
1149
+ const diffs = await diffRes.json();
1150
+ changedFiles = diffs.map((d) => d.new_path);
1151
+ } catch {
1152
+ }
1132
1153
  const event = {
1133
1154
  type: isMerge ? "merge" : "push",
1134
1155
  provider: "gitlab",
@@ -1136,7 +1157,8 @@ var GitListener = class extends EventEmitter {
1136
1157
  commit: commit.id,
1137
1158
  author: commit.author_name,
1138
1159
  message: commit.message,
1139
- timestamp: new Date(commit.created_at)
1160
+ timestamp: new Date(commit.created_at),
1161
+ changedFiles
1140
1162
  };
1141
1163
  this.emit("git-event", event);
1142
1164
  if (isMerge) {