mirror of
https://code.forgejo.org/actions/git-backporting
synced 2025-07-01 23:06:00 +02:00
feat: config file as option (#42)
Fix https://github.com/lampajr/backporting/issues/37 This enhancement required a huge refactoring where all arguments defaults have been centralized in one single place ArgsParser#parse
This commit is contained in:
parent
a88adeec35
commit
5ead31f606
27 changed files with 1465 additions and 219 deletions
|
@ -14,13 +14,13 @@ export default class GitLabClient implements GitClient {
|
|||
private readonly mapper: GitLabMapper;
|
||||
private readonly client: Axios;
|
||||
|
||||
constructor(token: string, apiUrl: string, rejectUnauthorized = false) {
|
||||
constructor(token: string | undefined, apiUrl: string, rejectUnauthorized = false) {
|
||||
this.logger = LoggerServiceFactory.getLogger();
|
||||
this.apiUrl = apiUrl;
|
||||
this.client = axios.create({
|
||||
baseURL: this.apiUrl,
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
Authorization: token ? `Bearer ${token}` : "",
|
||||
"User-Agent": "lampajr/backporting",
|
||||
},
|
||||
httpsAgent: new https.Agent({
|
||||
|
@ -30,6 +30,14 @@ export default class GitLabClient implements GitClient {
|
|||
this.mapper = new GitLabMapper(this.client);
|
||||
}
|
||||
|
||||
getDefaultGitUser(): string {
|
||||
return "Gitlab";
|
||||
}
|
||||
|
||||
getDefaultGitEmail(): string {
|
||||
return "noreply@gitlab.com";
|
||||
}
|
||||
|
||||
// READ
|
||||
|
||||
// example: <host>/api/v4/projects/alampare%2Fbackporting-example/merge_requests/1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue