Skip to content

Commit 73b3fcf

Browse files
committed
fix: ensure action runs from GitHub workspace and handle TLS build on musl
1 parent f19f728 commit 73b3fcf

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ RUN apk add --no-cache ca-certificates
5454
RUN addgroup -g 1000 appuser && \
5555
adduser -D -u 1000 -G appuser appuser
5656

57-
WORKDIR /app
58-
COPY --from=builder /app/target/release/pr-checker /app/pr-checker
57+
# GitHub Actions workspace is mounted at /github/workspace
58+
WORKDIR /github/workspace
59+
COPY --from=builder /app/target/release/pr-checker /usr/local/bin/pr-checker
5960

60-
# Set ownership
61-
RUN chown -R appuser:appuser /app
6261
# Switch to non-root user
6362
USER appuser
6463

65-
ENTRYPOINT ["/app/pr-checker"]
64+
ENTRYPOINT ["/usr/local/bin/pr-checker"]

src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod github;
1919
mod rules;
2020

2121
use clap::Parser;
22-
use tracing::{error, info};
22+
use tracing::{error, info, warn};
2323

2424
#[derive(Parser)]
2525
#[command(name = "pr-checker")]
@@ -59,6 +59,15 @@ async fn main() {
5959
)
6060
.init();
6161

62+
// Ensure we operate in the GitHub workspace when running as an Action
63+
if let Ok(ws) = std::env::var("GITHUB_WORKSPACE") {
64+
if let Err(e) = std::env::set_current_dir(&ws) {
65+
warn!("Failed to set current dir to GITHUB_WORKSPACE={ws}: {e}");
66+
} else {
67+
info!("Working directory set to GITHUB_WORKSPACE: {}", ws);
68+
}
69+
}
70+
6271
let args = Args::parse();
6372

6473
// Get config path from args or GitHub Actions input or default

0 commit comments

Comments
 (0)