Rosh Hashanah, Chapter 1, Mishnah 9. This mishnah addresses the question of in what manner and under what circumstances a person may desecrate Shabbos in order to set out and testify about the sighting of the new month - the sighting of the new moon.
The allowances the mishnah grants to witnesses setting out on the road:
"Ha'ro'eh es hachodesh v'eino yachol l'haleich" - one who saw the new moon and is unable to travel the distance on foot is mounted on a donkey; and if necessary, he is even carried on a bed.
"V'im tzodeh lahem" - if there is a danger that people will lie in wait for them along the way, they may take along sticks to defend themselves.
"V'im haysah derech rechokah" - if the distance to Jerusalem is long, they may take along food for the journey.
The limit of the allowance - a journey of a night and a day:
All of these allowances were stated only regarding a journey lasting one day and one night, that is, when the witnesses are able to reach their destination within twenty-four hours of sighting the moon. The reason: if they will not arrive on the thirtieth day of the month, which is the day that can be established as the first day of the coming month, then Rosh Chodesh will be fixed on the following day in any case. It turns out that their testimony accomplishes nothing, and therefore desecration of Shabbos is not permitted for its sake.
The source of the allowance:
For a journey of a night and a day one may desecrate Shabbos and go out to testify about the new month, as it says: "Eileh mo'adei Hashem asher tikre'u osam b'mo'adam" - "Eileh mo'adei Hashem" - these are the festivals of Hashem; "asher tikre'u osam" - that you shall proclaim and establish them; "b'mo'adam" - at their proper time. From the word "b'mo'adam," following the way the term "mo'ed" is used in the Torah, we learn that even on Shabbos it is permitted to carry out the act of establishing the new moon, and from here that one may desecrate Shabbos for the sake of testimony about the new month.
In summary: In this mishnah we learned the scope of the allowance to desecrate Shabbos for the sake of testimony about the new month: mounting the one who saw the moon on a donkey and even carrying him on a bed, taking sticks because of danger, and taking food for a long journey. This allowance is limited to a journey of a night and a day, since beyond that the testimony serves no purpose and the month is established in any case; and its basis is the verse "Eileh mo'adei Hashem asher tikre'u osam b'mo'adam," which teaches that the establishing of the festivals is done at its proper time even on Shabbos.