If one were to dream while sleeping of him or herself doing any sort of sin, is it a sin? (sources)
There is a Gemara (Berachos 57a) which mentions interpretations of various dreams, and many of them include doing a sin. For example:
הבא על נערה מאורסה יצפה לתורה שנאמר (דברים לג, ד) תורה צוה לנו משה מורשה קהלת יעקב אל תקרי מורשה אלא מאורשה
If one dreams he has intercourse with a betrothed maiden, he may expect to obtain knowledge of Torah, since it says, Moses commanded us a law [Torah], an inheritance of the congregation of Jacob. Read not morashah [inheritance], but me'orasah [betrothed].
There are many similar scenarios listed by the Gemara, and surely if it one has committed a sin by having this dream the Gemara would have noted so and not simply said it is a good sign.
Furthermore, while in a dream state one is not conscious of their "actions," which aren't really actions at all. It seems highly unreasonable to me that anyone would call such an "act" a sin per se.
At the same time, dreams reflect a person's subconscious. Therefore, if someone is having dreams about sins, they may want to do some introspection and try to figure out if there is anything unhealthy laying beneath their surface that needs to be fixed.