  This article presents a search for flavour-changing neutral currents in the
decay of a top quark into an up-type ($q = c, u$) quark and a Higgs boson,
where the Higgs boson decays into two photons. The proton--proton collision
data set analysed amounts to 36.1 fb$^{-1}$ at $\sqrt{s} = 13$ TeV collected by
the ATLAS experiment at the LHC. Top quark pair events are searched for, where
one top quark decays into $qH$ and the other decays into $bW$. Both the
hadronic and leptonic decay modes of the $W$ boson are used. No significant
excess is observed and an upper limit is set on the $t \rightarrow cH$
branching ratio of $2.2\times 10^{-3}$ at the 95% confidence level, while the
expected limit in the absence of signal is $1.6 \times 10^{-3}$. The
corresponding limit on the $tcH$ coupling is 0.090 at the 95% confidence level.
The observed upper limit on the $t \rightarrow uH$ branching ratio is $2.4
\times 10^{-3}$.
