I tried the following on the command prompt in bash:
sudo cat << EOF > /etc/yum.repos.d/some-name.repo #Content #.... #... EOF
It
Output redirection (e.g., >) is performed by bash, not by cat, while running with your UID. To run with root's UID use sudo:
sudo bash -c 'cat << EOF > /etc/yum.repos.d/some-name.repo line1 line2 line3 EOF'