Skip to content

Commit 82d5848

Browse files
committed
warn instead of fail on issue number write fail
1 parent e8cc706 commit 82d5848

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,17 @@ impl concourse_resource::Resource for GithubIssue {
162162
if source.number().is_none() {
163163
// store created issue number in file for subsequent check step
164164
let file_path = format!("{input_path}/issue_number.txt");
165-
std::fs::write(file_path, issue.number.to_string())
166-
.expect("issue number could not be written to {file_path}");
167-
log::info!("the issue number was stored in a file at '{input_path}/issue_number.txt'");
165+
match std::fs::write(&file_path, issue.number.to_string()) {
166+
Ok(_) => log::info!(
167+
"the issue number was stored in a file at '{input_path}/issue_number.txt'"
168+
),
169+
Err(error) => {
170+
log::warn!(
171+
"issue number could not be written to {file_path}, and issue number will therefore not be available for subsequent check step"
172+
);
173+
log::warn!("error: {error}");
174+
}
175+
}
168176
}
169177

170178
// return out step output

0 commit comments

Comments
 (0)