Nightwatch tests not found in issue fork's pipeline
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3407916. -->
Reported by: [pingwin4eg](https://www.drupal.org/user/1484468)
Related to !93
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>I noticed that for a contrib project pipelines (after pushing a new commit to an MR) sometimes run in the issue fork repo and sometimes in the main repo (I don't know why).<br>
And when this happens in the issue fork repo, nightwatch can't find tests because of incorrect tag. E.g.,<br>
<code>node -r dotenv-safe/config ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js --tag=styleswitcher-3403145</code></p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>The reference project issue and an MR:</p>
<ul>
<li><a href="https://www.drupal.org/project/styleswitcher/issues/3403145">https://www.drupal.org/project/styleswitcher/issues/3403145</a></li>
<li><a href="https://git.drupalcode.org/project/styleswitcher/-/merge_requests/2">https://git.drupalcode.org/project/styleswitcher/-/merge_requests/2</a></li>
</ul>
<p>Example nightwatch job log in the fork repo: <a href="https://git.drupalcode.org/issue/styleswitcher-3403145/-/jobs/467211">https://git.drupalcode.org/issue/styleswitcher-3403145/-/jobs/467211</a><br>
Example nightwatch job log in the main repo for reference: <a href="https://git.drupalcode.org/project/styleswitcher/-/jobs/467443">https://git.drupalcode.org/project/styleswitcher/-/jobs/467443</a></p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>As suggested by @fjgarlin in slack, replace <code>$CI_PROJECT_NAME</code> for <code>${CI_PROJECT_NAME%-*}</code> in that line. That strips out anything after the hypen (<code>-</code>), as forks are named <code>module_name-12345</code>.</p>
issue