I ran into this issue when I needed to replace the gas tank on my 1976 CJ-7. I believe the 76 and 77 are the same. The problem is that Jeep put what ever they had on hand at the time to build the current Jeep. I have a 1976 but found out I had a 1975 gas tank, and later found out I have the front Dana inner bearings and hubs from a 1977 when I converted over to disk brakes on the front after I had purchased new bearings and Hubs I did not need. As I bought the Jeep new, I know that is how it came. So make sure you check what you have before you buy anything. I believe the filler neck is different from the 1975 to the 76-77.
Here is a link for a gas tank on Ebay, I have seen this same tank for twice the price on other popular 4 wheel sites.