@aspruyt/xfg 6.4.0 → 6.4.1

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/PR.md CHANGED
@@ -8,6 +8,6 @@ Automated sync of configuration files to ${xfg:repo.fullName}.
8
8
 
9
9
  ${xfg:pr.fileChanges}
10
10
 
11
- ---
11
+ ______________________________________________________________________
12
12
 
13
13
  _This PR was automatically generated by [xfg](https://github.com/anthony-spruyt/xfg)_
package/README.md CHANGED
@@ -1,13 +1,8 @@
1
1
  # xfg
2
2
 
3
- [![CI](https://github.com/anthony-spruyt/xfg/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/anthony-spruyt/xfg/actions/workflows/ci.yaml)
4
- [![codecov](https://codecov.io/gh/anthony-spruyt/xfg/graph/badge.svg)](https://codecov.io/gh/anthony-spruyt/xfg)
5
- [![Socket Badge](https://badge.socket.dev/npm/package/@aspruyt/xfg)](https://socket.dev/npm/package/@aspruyt/xfg)
6
- [![npm version](https://img.shields.io/npm/v/@aspruyt/xfg.svg)](https://www.npmjs.com/package/@aspruyt/xfg)
7
- [![npm downloads](https://img.shields.io/npm/dw/@aspruyt/xfg.svg)](https://www.npmjs.com/package/@aspruyt/xfg)
8
- [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-xfg-blue?logo=github)](https://github.com/marketplace/actions/xfg-repo-as-code)
9
- [![docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://anthony-spruyt.github.io/xfg/)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
3
+ [![CI](https://github.com/anthony-spruyt/xfg/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/anthony-spruyt/xfg/actions/workflows/ci.yaml) [![codecov](https://codecov.io/gh/anthony-spruyt/xfg/graph/badge.svg)](https://codecov.io/gh/anthony-spruyt/xfg) [![Socket Badge](https://badge.socket.dev/npm/package/@aspruyt/xfg)](https://socket.dev/npm/package/@aspruyt/xfg)
4
+ [![npm version](https://img.shields.io/npm/v/@aspruyt/xfg.svg)](https://www.npmjs.com/package/@aspruyt/xfg) [![npm downloads](https://img.shields.io/npm/dw/@aspruyt/xfg.svg)](https://www.npmjs.com/package/@aspruyt/xfg) [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-xfg-blue?logo=github)](https://github.com/marketplace/actions/xfg-repo-as-code)
5
+ [![docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://anthony-spruyt.github.io/xfg/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
11
6
 
12
7
  Manage files, settings, and repositories across GitHub, Azure DevOps, and GitLab — declaratively, from a single YAML config.
13
8
 
@@ -41,12 +41,33 @@ export class FileWriter {
41
41
  if (file.createOnly) {
42
42
  const existsOnBase = await gitOps.fileExistsOnBranch(file.fileName, baseBranch);
43
43
  if (existsOnBase) {
44
- log.info(`Skipping ${file.fileName} (createOnly: exists on ${baseBranch})`);
45
- fileChanges.set(file.fileName, {
46
- fileName: file.fileName,
47
- content: null,
48
- action: "skip",
49
- });
44
+ const desiredMode = shouldBeExecutable(file)
45
+ ? "100755"
46
+ : "100644";
47
+ const currentMode = await gitOps.getFileMode(file.fileName);
48
+ modeCache.set(file.fileName, currentMode);
49
+ const modeDiffers = currentMode !== null && currentMode !== desiredMode;
50
+ if (modeDiffers) {
51
+ fileChanges.set(file.fileName, {
52
+ fileName: file.fileName,
53
+ content: null,
54
+ action: "update",
55
+ mode: desiredMode,
56
+ modeOnly: true,
57
+ });
58
+ incrementDiffStats(diffStats, "MODIFIED");
59
+ if (dryRun) {
60
+ log.info(`Would change mode: ${file.fileName} ${currentMode} -> ${desiredMode}`);
61
+ }
62
+ }
63
+ else {
64
+ log.info(`Skipping ${file.fileName} (createOnly: exists on ${baseBranch})`);
65
+ fileChanges.set(file.fileName, {
66
+ fileName: file.fileName,
67
+ content: null,
68
+ action: "skip",
69
+ });
70
+ }
50
71
  return;
51
72
  }
52
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspruyt/xfg",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "description": "Manage files, settings, and repositories across GitHub, Azure DevOps, and GitLab — declaratively, from a single YAML config",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",