Skip to content

Commit

Permalink
Handle calendar repo containing xtask in CI
Browse files Browse the repository at this point in the history
The CI iterates over and calls `toml-to-ical` on all `.toml` files in
the `calendar` repo.  However, we'd like to add an `xtask` directory
to the `calendar` repo, and that directory will contain non-calendar
TOML files.  We may also want a top-level `Cargo.toml` file.

To support this, let's skip any files named `Cargo.toml` (a calendar
for the cargo team would be in lowercase) and a top-level directory
named `xtask`.
  • Loading branch information
traviscross authored and davidtwco committed Nov 21, 2024
1 parent eb8cf1d commit 9bf0ccb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ mkdir -p "$2"
shopt -s globstar
for path in "$1"/**/*.toml; do
filepath=${path##$1/}
filename="${path##*/}"
firstpath="${filepath%%/*}"
if test "$firstpath" = "xtask" \
|| test "$filename" = "Cargo.toml"; then
continue
fi
mkdir -p $2/$(dirname "$filepath")
toml-to-ical -i $path -o $2/${filepath%.*}.ics
done

0 comments on commit 9bf0ccb

Please sign in to comment.