github-issue-exporter 0.0.1__tar.gz → 0.1.0__tar.gz

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 (19) hide show
  1. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/PKG-INFO +22 -4
  2. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/README.md +21 -3
  3. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/pyproject.toml +1 -1
  4. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/auth.py +29 -0
  5. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/uv.lock +1 -1
  6. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/.github/workflows/publish.yml +0 -0
  7. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/.gitignore +0 -0
  8. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/.python-version +0 -0
  9. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/architecture.md +0 -0
  10. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/__init__.py +0 -0
  11. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/__main__.py +0 -0
  12. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/cli/__init__.py +0 -0
  13. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/cli/main.py +0 -0
  14. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/__init__.py +0 -0
  15. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/config.py +0 -0
  16. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/export_engine.py +0 -0
  17. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/filesystem.py +0 -0
  18. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/github_client.py +0 -0
  19. {github_issue_exporter-0.0.1 → github_issue_exporter-0.1.0}/src/github_issue_exporter/core/transformer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-issue-exporter
3
- Version: 0.0.1
3
+ Version: 0.1.0
4
4
  Summary: Export GitHub issues to individual JSON files with incremental updates and credential management
5
5
  Project-URL: Homepage, https://github.com/Beep-Boop-Digital/github-issue-exporter
6
6
  Project-URL: Repository, https://github.com/Beep-Boop-Digital/github-issue-exporter
@@ -60,13 +60,31 @@ github-issue-exporter owner/repo --state open
60
60
 
61
61
  ## Authentication
62
62
 
63
- The tool will automatically prompt for a GitHub Personal Access Token when needed. You can create one at: https://github.com/settings/tokens
63
+ The tool supports multiple authentication methods:
64
+
65
+ ### Environment Variables (Recommended for CI/CD)
66
+
67
+ ```bash
68
+ # Global token for all repositories
69
+ export GITHUB_TOKEN="your_token_here"
70
+
71
+ # Repository-specific token (takes precedence over global)
72
+ export GITHUB_TOKEN_OWNER_REPO="your_token_here"
73
+ # Example: GITHUB_TOKEN_BEEP_BOOP_DIGITAL_GITHUB_ISSUE_EXPORTER="token"
74
+ ```
75
+
76
+ ### Interactive Prompt
77
+
78
+ If no environment variables are set, the tool will automatically prompt for a GitHub Personal Access Token. You can create one at: https://github.com/settings/tokens
79
+
80
+ ### Required Scopes
64
81
 
65
- Required scopes:
66
82
  - `repo` (for private repositories)
67
83
  - `public_repo` (for public repositories)
68
84
 
69
- Tokens are stored securely using encryption and can be managed per-repository.
85
+ ### Token Storage
86
+
87
+ Interactively provided tokens are stored securely using encryption and can be managed per-repository. Environment variable tokens are not stored.
70
88
 
71
89
  ## Configuration
72
90
 
@@ -44,13 +44,31 @@ github-issue-exporter owner/repo --state open
44
44
 
45
45
  ## Authentication
46
46
 
47
- The tool will automatically prompt for a GitHub Personal Access Token when needed. You can create one at: https://github.com/settings/tokens
47
+ The tool supports multiple authentication methods:
48
+
49
+ ### Environment Variables (Recommended for CI/CD)
50
+
51
+ ```bash
52
+ # Global token for all repositories
53
+ export GITHUB_TOKEN="your_token_here"
54
+
55
+ # Repository-specific token (takes precedence over global)
56
+ export GITHUB_TOKEN_OWNER_REPO="your_token_here"
57
+ # Example: GITHUB_TOKEN_BEEP_BOOP_DIGITAL_GITHUB_ISSUE_EXPORTER="token"
58
+ ```
59
+
60
+ ### Interactive Prompt
61
+
62
+ If no environment variables are set, the tool will automatically prompt for a GitHub Personal Access Token. You can create one at: https://github.com/settings/tokens
63
+
64
+ ### Required Scopes
48
65
 
49
- Required scopes:
50
66
  - `repo` (for private repositories)
51
67
  - `public_repo` (for public repositories)
52
68
 
53
- Tokens are stored securely using encryption and can be managed per-repository.
69
+ ### Token Storage
70
+
71
+ Interactively provided tokens are stored securely using encryption and can be managed per-repository. Environment variable tokens are not stored.
54
72
 
55
73
  ## Configuration
56
74
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "github-issue-exporter"
3
- version = "0.0.1"
3
+ version = "0.1.0"
4
4
  description = "Export GitHub issues to individual JSON files with incremental updates and credential management"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import os
2
3
  from typing import Optional, Tuple
3
4
  import httpx
4
5
  from rich.console import Console
@@ -87,8 +88,36 @@ class AuthenticationHandler:
87
88
 
88
89
  return token.strip()
89
90
 
91
+ def _get_env_token(self, repo_full_name: str) -> Optional[str]:
92
+ """Check for GitHub token in environment variables."""
93
+ # First check for repository-specific token
94
+ repo_owner, repo_name = repo_full_name.split('/', 1)
95
+ repo_env_var = f"GITHUB_TOKEN_{repo_owner}_{repo_name}".upper().replace('-', '_').replace('.', '_')
96
+ repo_token = os.getenv(repo_env_var)
97
+
98
+ if repo_token:
99
+ return repo_token.strip()
100
+
101
+ # Fall back to global token
102
+ global_token = os.getenv('GITHUB_TOKEN')
103
+ if global_token:
104
+ return global_token.strip()
105
+
106
+ return None
107
+
90
108
  async def get_or_prompt_credentials(self, repo_full_name: str) -> Optional[str]:
91
109
  """Get existing credentials or prompt for new ones."""
110
+ # Check environment variables first
111
+ env_token = self._get_env_token(repo_full_name)
112
+ if env_token:
113
+ # Validate environment token
114
+ is_valid, result = await self.validate_credentials(env_token, repo_full_name)
115
+ if is_valid:
116
+ self.console.print(f"[green]Using environment token for {repo_full_name} (user: {result})[/green]")
117
+ return env_token
118
+ else:
119
+ self.console.print(f"[red]Environment token for {repo_full_name} is invalid: {result}[/red]")
120
+
92
121
  # Check if we have stored credentials for this repo
93
122
  stored_token = self.config_manager.get_repo_token(repo_full_name)
94
123
 
@@ -143,7 +143,7 @@ wheels = [
143
143
 
144
144
  [[package]]
145
145
  name = "github-issue-exporter"
146
- version = "0.0.1"
146
+ version = "0.1.0"
147
147
  source = { editable = "." }
148
148
  dependencies = [
149
149
  { name = "cryptography" },