fix(workflow): repair always-skipped 'Replace repo owner' if-syntax#19
Merged
Conversation
…yntax
The condition was written as:
if: ${{ github.event.repository.owner.login }} != marksverdhei
This mixes ${{ }} pre-substitution with bare-text comparison. GHA
evaluates the value as an expression after substitution, so the literal
becomes '<owner_login> != marksverdhei'. Both sides are unquoted
identifiers that resolve to undefined context refs (null), and 'null !=
null' is false. Net effect: the step was *always skipped*, so every
new repo created from this template kept its marksverdhei references
unreplaced.
Moves the comparison fully inside one expression scope:
if: github.event.repository.owner.login != 'marksverdhei'
The quoted literal and the property reference now share the same
expression evaluator, and the step runs whenever the owner isn't
marksverdhei (the intent expressed in the comment).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
```yaml
if: ${{ github.event.repository.owner.login }} != marksverdhei
```
This mixes `${{ }}` pre-substitution with a bare-text right-hand side. GHA evaluates the entire `if` value as an expression after substitution:
Effect: every new repo created from this template kept its `marksverdhei` references unreplaced. The bug never bit Markus's own usage of the template (other workflows would have caught it cosmetically) but is wrong for anyone else cloning the template — and silently so.
Fix
```yaml
if: github.event.repository.owner.login != 'marksverdhei'
```
Move the comparison entirely inside one expression scope. The quoted literal and the property reference now share the same evaluator, and the step runs whenever the owner isn't `marksverdhei` (matching the intent in the inline comment).
Why no test
This is a CI workflow — no local-runnable test suite to add to. The next time a non-marksverdhei user (real or test) clones from this template, the step will run and `marksverdhei` references will be replaced as documented.