Skip to content

Commit

Permalink
improve changelog xtask (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilgardis authored Jan 31, 2024
2 parents 0547637 + 47d01e7 commit 8d383f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .changes/1403-1411.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
},
{
"type": "added",
"description": "Added helper script `/freebsd-install-package.sh` and friends to install freebsd packages, see [wiki](https://github.com/cross-rs/cross/wiki/FAQ#custom-images)",
"description": "Added helper script `/freebsd-install-package.sh` and friends to install freebsd packages, see [wiki](https://github.com/cross-rs/cross/wiki/FAQ#custom-images)"
}]
8 changes: 2 additions & 6 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
files: |
.changes/*.json
- name: Validate Changelog Files
- name: Validate Changelog
id: changelog
run: |
set -x
Expand All @@ -34,10 +34,6 @@ jobs:
echo "Must add or remove changes or add the 'no changelog' label"
exit 1
else
basenames=()
for path in "${added_modified[@]}"; do
basenames+=($(basename "${path}"))
done
cargo xtask changelog validate "${basenames[@]}"
cargo xtask changelog validate
fi
fi
4 changes: 2 additions & 2 deletions xtask/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use std::path::Path;

use crate::util::{project_dir, write_to_string};
use cross::shell::MessageInfo;
use cross::ToUtf8;

use chrono::{Datelike, Utc};
use clap::{Args, Subcommand};
use cross::ToUtf8;
use eyre::Context;
use serde::Deserialize;

Expand Down Expand Up @@ -516,7 +516,7 @@ pub fn validate_changelog(
) -> cross::Result<()> {
let root = project_dir(msg_info)?;
let changes_dir = root.join(".changes");
if files.is_empty() && std::env::var("GITHUB_ACTIONS").is_err() {
if files.is_empty() {
files = fs::read_dir(&changes_dir)?
.filter_map(|x| x.ok())
.filter(|x| x.file_type().map_or(false, |v| v.is_file()))
Expand Down

0 comments on commit 8d383f7

Please sign in to comment.