aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-03-09 19:04:17 -0800
committerFuwn <[email protected]>2022-03-09 19:04:17 -0800
commit3c4a278db3e5b9696269caefad2bfaa79578704c (patch)
tree096febe388721081a092f09582bdd9589c6b6cbd /src
parentfeat(index): git commit hash on index (diff)
downloadapi-worker-3c4a278db3e5b9696269caefad2bfaa79578704c.tar.xz
api-worker-3c4a278db3e5b9696269caefad2bfaa79578704c.zip
refactor: use vergen for build variables
Diffstat (limited to 'src')
-rw-r--r--src/constants.rs2
-rw-r--r--src/lib.rs2
-rw-r--r--src/utils.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/constants.rs b/src/constants.rs
index b5fb1e0..6f3e6e4 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -24,7 +24,7 @@ lazy_static::lazy_static! {
include_str!("index.rst"),
format_args!(
"https://github.com/senpy-club/api-worker/tree/{}",
- env!("GIT_COMMIT_HASH"),
+ env!("VERGEN_GIT_SHA"),
)
)
};
diff --git a/src/lib.rs b/src/lib.rs
index 229472a..e5661dc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,7 +62,7 @@ pub async fn main(
.get("/v2/version", |_, _| {
Response::from_json(&serde_json::json!({
"crate_version": env!("CARGO_PKG_VERSION"),
- "git_commit_hash": env!("GIT_COMMIT_HASH"),
+ "git_commit_hash": env!("VERGEN_GIT_SHA"),
}))?
.with_cors(&utils::cors())
})
diff --git a/src/utils.rs b/src/utils.rs
index d48ff34..8bb70da 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -28,7 +28,7 @@ pub async fn github_api(
.get(constants::GITHUB_API_ENDPOINT)
.header(
"User-Agent",
- format!("senpy-club/api-worker - {}", env!("GIT_COMMIT_HASH")),
+ format!("senpy-club/api-worker - {}", env!("VERGEN_GIT_SHA")),
);
if std::env::var("GITHUB_TOKEN").is_ok() {