The Shulchan Aruch · Orach Chayim
אורח חיים תי״חOrach Chayim 418
Siman 418 of 697 in Orach Chayim — 5 se'ifim
הלכות ראש חודשLaws of Rosh Chodesh· siman 418
Se’if 1א׳
רֹאשׁ חֹדֶשׁ אָסוּר בְּתַעֲנִית.
The law of fasting on the beginning of the month. Containing five sections. On the beginning of the month it is forbidden to fast.
Se’if 2ב׳
אֵין גּוֹזְרִין תַּעֲנִית עַל הַצִּבּוּר בְּרָאשֵׁי חֳדָשִׁים, חֲנֻכָּה וּפוּרִים. וְאִם הִתְחִילוּ, שֶׁגָּזְרוּ לְהִתְעַנּוֹת כָּךְ וְכָךְ יָמִים וְהִתְחִילוּ בָּהֶם קֹדֶם רֹאשׁ חֹדֶשׁ אֲפִלּוּ יוֹם אֶחָד, אֵין מַפְסִיקִין, וּמִתְעַנִּין וּמַשְׁלִימִין.
Fasts are not decreed for the congregation to occur on the beginning of the month, on Chanukah, or on Purim. If they began, i.e. they declared a fast of a specified number of days, beginning from before the beginning of the month, then even on the first of the month they shall not disrupt [the fast. Instead] they shall fast and remedy it.
Se’if 3ג׳
יָחִיד שֶׁקִּבֵּל עָלָיו תַּעֲנִית כָּךְ וְכָךְ יָמִים וּפָגַע בּוֹ רֹאשׁ חֹדֶשׁ, אוֹ שֶׁקִּבֵּל עָלָיו לְהִתְעַנּוֹת בְּרֹאשׁ חֹדֶשׁ, אִם קִבְּלוֹ בִּלְשׁוֹן קַבָּלַת תַּעֲנִית בְּעָלְמָא אֵינוֹ צָרִיךְ הַתָּרָה. וְאִם קִבְּלוֹ עָלָיו בִּלְשׁוֹן: הֲרֵי עָלַי, שֶׁהוּא לְשׁוֹן נֶדֶר, צָרִיךְ הַתָּרַת חָכָם. וְעַיֵּן בְּיוֹרֵה דֵּעָה סִימָן רט"ו (ס"ג).
An individual who commits himself to a fast of a specified number of days, and the beginning of the month interrupts, or if he commits himself to fast on the beginning of the month: If he committed himself using common language of accepting fast, he does not require formal release from his vow (and his pledge is automatically abrogated). But if he committed himself with the phrasing "I hereby accept upon myself," i.e. the language used for an oath, he needs to be released from his vow by a sage. See Yoreh De'ah, Chapter 216 section 3.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0