<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xml:base="https://bjorn.now/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Drone-Ci on bjorn.now</title><link>https://bjorn.now/tags/drone-ci/</link><description>Recent content in Drone-Ci on bjorn.now</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 15 Aug 2025 15:24:00 +0800</lastBuildDate><atom:link href="https://bjorn.now/tags/drone-ci/feed.xml" rel="self" type="application/rss+xml"/><item><title>Drone CI handling of ${VAR} vs. $VAR</title><link>https://bjorn.now/til/2025-08-02-drone-ci-has-special-handling-for-var-and-will-replace-it-itself-instead-of-letting-the-shell-do-it/?utm_medium=feed</link><pubDate>Sat, 02 Aug 2025 09:37:29 +0800</pubDate><guid>https://bjorn.now/til/2025-08-02-drone-ci-has-special-handling-for-var-and-will-replace-it-itself-instead-of-letting-the-shell-do-it/</guid><description>Drone CI has special handling for ${VAR} and will replace it itself instead of letting the shell do it. So if you have export PATH=${GOPATH}/bin:$PATH and have $GOPATH defined in your global environment key, then it’ll become a blank value. But if you do export PATH=$GOPATH/bin:$PATH it’ll work. You can escape by adding an extra dollar sign, i.e. $${VAR} will be evaluated by the shell.
This is different from normal shell where ${VAR} is the same as $VAR and it exists to make sure you can concatenate strings without issues, i.e.</description><content:encoded><![CDATA[<p>Drone CI has special handling for <code>${VAR}</code> and will replace it <strong>itself</strong> instead of letting the shell do it. So if you have <code>export PATH=${GOPATH}/bin:$PATH</code> and have <code>$GOPATH</code> defined in your global environment key, then it&rsquo;ll become a blank value. But if you do <code>export PATH=$GOPATH/bin:$PATH</code> it&rsquo;ll work. You <a href="https://laszlo.cloud/drone-environment-variables-three-tips#when-variables-resolve-to-empty-string">can escape by adding an extra dollar sign</a>, i.e. <code>$${VAR}</code> will be evaluated by the shell.</p>
<p>This is different from normal shell where <code>${VAR}</code> is the same as <code>$VAR</code> and it exists to make sure you can concatenate strings without issues, i.e.</p>
<div class=" copy-enabled">
  <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl"><span class="nv">VAR</span><span class="o">=</span>m000
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;&#39;</span><span class="si">${</span><span class="nv">VAR</span><span class="si">}</span><span class="s2">est&#39;&#34;</span>  <span class="c1"># =&gt; &#39;m000est&#39;</span>
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;&#39;</span><span class="nv">$VARest</span><span class="s2">&#39;&#34;</span>    <span class="c1"># =&gt; &#39;&#39;</span></span></span></code></pre></div>
</div>
]]></content:encoded></item><item><title>Drone CI's DAG ignores skipped steps</title><link>https://bjorn.now/til/2025-08-02-drone-ci-will-not-smartly-skip-subsequent-steps-if-you-have-a-when-on-the-very-first-step-in-a-depends-on-chain/?utm_medium=feed</link><pubDate>Sat, 02 Aug 2025 09:37:29 +0800</pubDate><guid>https://bjorn.now/til/2025-08-02-drone-ci-will-not-smartly-skip-subsequent-steps-if-you-have-a-when-on-the-very-first-step-in-a-depends-on-chain/</guid><description>Drone CI will not smartly skip subsequent steps if you have a when on the very first step in a depends_on chain, so you have to repeat the when condition for each step because it doesn’t realize that the first dependency is gone.</description><content:encoded><![CDATA[<p>Drone CI will <strong>not</strong> smartly skip subsequent steps if you have a <code>when</code> on the very first step in a <code>depends_on</code> chain, so you have to repeat the <code>when</code> condition for each step because it doesn&rsquo;t realize that the first dependency is gone.</p>
]]></content:encoded></item><item><title>Drone CI's when targets the merge target for PR events</title><link>https://bjorn.now/til/2025-08-02-drone-cis-when-for-deciding-in-which-cases-to-run-steps-pipelines-targets-https/?utm_medium=feed</link><pubDate>Sat, 02 Aug 2025 09:37:29 +0800</pubDate><guid>https://bjorn.now/til/2025-08-02-drone-cis-when-for-deciding-in-which-cases-to-run-steps-pipelines-targets-https/</guid><description>Drone CI’s when for deciding in which cases to run steps/pipelines targets the merge target branch for PRs and not the actual PR’s, also it pulls from refs/pull/&lt;num&gt;/head instead of refs/heads/&lt;branch&gt; so you can’t target the branch itself using the pull_request event (use push on the pipeline and then branch for the step instead).</description><content:encoded><![CDATA[<p>Drone CI&rsquo;s <code>when</code> for deciding in which cases to run steps/pipelines <a href="https://docs.drone.io/pipeline/docker/syntax/conditions/#by-branch">targets</a> the <strong>merge target</strong> branch for PRs and not the actual PR&rsquo;s, also it pulls from <code>refs/pull/&lt;num&gt;/head</code> instead of <code>refs/heads/&lt;branch&gt;</code> so you can&rsquo;t target the branch itself using the <code>pull_request</code> event (use <code>push</code> on the pipeline and then <code>branch</code> for the step instead).</p>
]]></content:encoded></item></channel></rss>