gh-secrets-sync 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.md +4 -4
  2. package/dist/cli.mjs +4 -4
  3. package/package.json +11 -11
package/README.md CHANGED
@@ -38,7 +38,7 @@ If GitHub CI feels too complex, you can simply run it locally:
38
38
 
39
39
  ```bash
40
40
  # Set your token and secret values in env
41
- export GITHUB_PAT=...
41
+ export GH_PAT=...
42
42
  export VSCE_PAT=...
43
43
  export OVSX_PAT=...
44
44
 
@@ -80,14 +80,14 @@ jobs:
80
80
  # if regex patterns are used in `repos` or `secrets` must set `--yes` in GitHub Actions
81
81
  run: npx gh-secrets-sync --yes
82
82
  env:
83
- GITHUB_PAT: ${{secrets.GITHUB_PAT}}
83
+ GH_PAT: ${{secrets.GH_PAT}}
84
84
  VSCE_PAT: ${{secrets.VSCE_PAT}}
85
85
  OVSX_PAT: ${{secrets.OVSX_PAT}}
86
86
  ```
87
87
 
88
88
  **Configure secrets in your central repository**:
89
89
  - Go to your central repository Settings > Secrets and variables > Actions
90
- - Add `GITHUB_PAT` as a repository secret (this is your GitHub Personal Access Token)
90
+ - Add `GH_PAT` as a repository secret (this is your GitHub Personal Access Token)
91
91
  - Add `VSCE_PAT` and `OVSX_PAT` as repository secrets
92
92
 
93
93
  ### How to Get Your GitHub Token
@@ -100,7 +100,7 @@ jobs:
100
100
  - Repository permissions > Actions: Read and write
101
101
  - Metadata
102
102
  5. Click "Generate token"
103
- 6. Add the token as a repository secret named `GITHUB_PAT` in your central repository
103
+ 6. Add the token as a repository secret named `GH_PAT` in your central repository
104
104
 
105
105
  ## License
106
106
 
package/dist/cli.mjs CHANGED
@@ -10,7 +10,7 @@ import Spinner from 'yocto-spinner';
10
10
  import sodium from 'libsodium-wrappers';
11
11
 
12
12
  const name = "gh-secrets-sync";
13
- const version = "0.1.1";
13
+ const version = "0.1.3";
14
14
 
15
15
  const DEFAULT_SYNC_OPTIONS = {
16
16
  config: "./secrets.config.yaml",
@@ -215,7 +215,7 @@ async function normalizeConfig(options) {
215
215
  if (typeof options.secrets === "string")
216
216
  options.secrets = [options.secrets];
217
217
  const config = { ...DEFAULT_SYNC_OPTIONS, ...options };
218
- config.token = config.token || process.env.GITHUB_PAT || process.env.GITHUB_TOKEN || await readTokenFromGitHubCli();
218
+ config.token = config.token || process.env.GH_PAT || process.env.GITHUB_TOKEN || await readTokenFromGitHubCli();
219
219
  if (config.repos.length && config.secrets.length) {
220
220
  return config;
221
221
  }
@@ -242,7 +242,7 @@ async function resolveConfig(options) {
242
242
  }
243
243
  async function resolveRepoPatterns(options) {
244
244
  const filter = createRegexFilter(options.repos, "full_name");
245
- let repos = (await getRepos(options)).filter((i) => filter(i) && (options.private || !i.private)).map((i) => i.full_name);
245
+ let repos = (await getRepos(options)).filter((i) => filter(i) && (options.private || !i.private)).filter((i) => options.fork || !i.fork).map((i) => i.full_name);
246
246
  if (repos.length) {
247
247
  repos = [.../* @__PURE__ */ new Set([...options.repos, ...repos])];
248
248
  }
@@ -295,7 +295,7 @@ async function resolveSecretPatterns(options) {
295
295
 
296
296
  try {
297
297
  const cli = cac("gh-secrets-sync");
298
- cli.command("").option("--config <config>", "secrets config file", { default: "./secrets.config.yaml" }).option("--secrets <secrets...>", "secrets name to sync", { default: [] }).option("--token <token>", "GitHub token").option("--api-version <version>", "GitHub API version", { default: "2022-11-28" }).option("--private", "Detect private repositories", { default: false }).option("--env-prefix <prefix>", "environment variable prefix", { default: "" }).option("--repo <repo>", "central GitHub repository").option("--strict", "Throw error if secret is not found in the environment variables", { default: true }).option("--yes", "Prompt to confirm resolved matches when regex patterns are used in repos or secrets", { default: false }).option("--dry", "Dry run", { default: false }).allowUnknownOptions().action(async (options) => {
298
+ cli.command("").option("--config <config>", "secrets config file", { default: "./secrets.config.yaml" }).option("--secrets <secrets...>", "secrets name to sync", { default: [] }).option("--token <token>", "GitHub token").option("--api-version <version>", "GitHub API version", { default: "2022-11-28" }).option("--private", "Detect private repositories", { default: false }).option("--fork", "Detect forked repositories", { default: false }).option("--env-prefix <prefix>", "environment variable prefix", { default: "" }).option("--repo <repo>", "central GitHub repository").option("--strict", "Throw error if secret is not found in the environment variables", { default: true }).option("--yes", "Prompt to confirm resolved matches when regex patterns are used in repos or secrets", { default: false }).option("--dry", "Dry run", { default: false }).allowUnknownOptions().action(async (options) => {
299
299
  console.log(`${c.yellow(name)} ${c.dim(`v${version}`)}`);
300
300
  console.log();
301
301
  const config = await resolveConfig(options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gh-secrets-sync",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "description": "CLI tool to batch sync GitHub Actions secrets across multiple repositories.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
@@ -46,18 +46,18 @@
46
46
  "yocto-spinner": "^1.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@antfu/eslint-config": "^5.2.0",
49
+ "@antfu/eslint-config": "^5.2.1",
50
50
  "@types/libsodium-wrappers": "^0.7.14",
51
- "@types/node": "^24.2.0",
52
- "bumpp": "^10.2.2",
53
- "eslint": "^9.32.0",
54
- "lint-staged": "^16.1.4",
55
- "pncat": "^0.4.1",
51
+ "@types/node": "^24.3.0",
52
+ "bumpp": "^10.2.3",
53
+ "eslint": "^9.33.0",
54
+ "lint-staged": "^16.1.5",
55
+ "pncat": "^0.4.2",
56
56
  "simple-git-hooks": "^2.13.1",
57
- "taze": "^19.1.0",
58
- "tsx": "^4.20.3",
57
+ "taze": "^19.3.0",
58
+ "tsx": "^4.20.4",
59
59
  "typescript": "^5.9.2",
60
- "unbuild": "^3.6.0",
60
+ "unbuild": "^3.6.1",
61
61
  "vitest": "^3.2.4"
62
62
  },
63
63
  "simple-git-hooks": {
@@ -69,7 +69,7 @@
69
69
  "scripts": {
70
70
  "start": "tsx ./src/cli.ts",
71
71
  "build": "unbuild",
72
- "typecheck": "tsc",
72
+ "typecheck": "tsc --noEmit",
73
73
  "test": "vitest",
74
74
  "lint": "eslint",
75
75
  "deps": "taze major -I",