Context. Nearly a dozen star-forming galaxies have been detected in γ-rays by the Fermi observatory in the last decade. A remarkable property of this sample is the quasi-linear relation between the γ-ray luminosity and the star formation rate, which was obtained assuming that the latter is well traced by the infrared luminosity of the galaxies. The non-linearity of this relation has not been fully explained yet. Aims. We aim to determine the biases derived from the use of the infrared luminosity as a proxy for the star formation rate and to shed light on the more fundamental relation between the latter and the γ-ray luminosity. We expect to quantify and explain some trends observed in this relation. Methods. We compiled a near-homogeneous set of distances, ultraviolet, optical, infrared, and γ-ray fluxes from the literature for all known γ-ray emitting, star-forming galaxies. From these data, we computed the infrared and γ-ray luminosities, and star formation rates. We determined the best-fitting relation between the latter two, and we describe the trend using simple, population-orientated models for cosmic-ray transport and cooling. Results. We find that the γ-ray luminosity–star formation rate relation obtained from infrared luminosities is biased to shallower slopes. The actual relation is steeper than previous estimates, having a power-law index of 1.35 ± 0.05, in contrast to 1.23 ± 0.06. Conclusions. The unbiased γ-ray luminosity–star formation rate relation can be explained at high star formation rates by assuming that the cosmic-ray cooling region is kiloparsec-sized and pervaded by mild to fast winds. Combined with previous results about the scaling of wind velocity with star formation rate, our work provides support to advection as the dominant cosmic-ray escape mechanism in galaxies with low star formation rates.