Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/git-command-manager.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts
index a45e15a..eba285a 100644
--- a/src/git-command-manager.ts
+++ b/src/git-command-manager.ts
@@ -730,7 +730,19 @@ class GitCommandManager {
}
}
// Set the user agent
- const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`
+ let gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`
+
+ // Append orchestration ID if set
+ const orchId = process.env['ACTIONS_ORCHESTRATION_ID']
+ if (orchId) {
+ // Sanitize the orchestration ID to ensure it contains only valid characters
+ // Valid characters: 0-9, a-z, _, -, .
+ const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_')
+ if (sanitizedId) {
+ gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`
+ }
+ }
+
core.debug(`Set git useragent to: ${gitHttpUserAgent}`)
this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent
}