fix(ci): check for tag using the correct format (#3495)
### **PR Type**
Bug fix
___
### **Description**
- Declare `TAG_NAME` from make release-tag-name
- Use `TAG_NAME` in git tag existence check
- Update echo messages to reference correct tag
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Compute TAG_NAME"] --> B["Compute VERSION"]
B --> C["Check if tag exists"]
C -->|exists| D["Skip release preparation"]
C -->|not exists| E["Proceed with release"]
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>ci_update_changelog.yaml</strong><dd><code>Use TAG_NAME
for tag existence check</code>
</dd></summary>
<hr>
.github/workflows/ci_update_changelog.yaml
<ul><li>Declare <code>TAG_NAME</code> variable using make
release-tag-name<br> <li> Replace <code>${{ matrix.project }}</code>
with <code>TAG_NAME</code> in grep<br> <li> Update echo commands to
reference <code>TAG_NAME</code> correctly</ul>
</details>
</td>
<td><a
href="https://github.com/nhost/nhost/pull/3495/files#diff-399add8ac39ae1cd7ae2f4f8ceb89290f6f43e25b7b2c499da61dd68a5cf2f16">+3/-2</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
This commit is contained in:
7
.github/workflows/ci_update_changelog.yaml
vendored
7
.github/workflows/ci_update_changelog.yaml
vendored
@@ -56,11 +56,12 @@ jobs:
|
||||
id: version
|
||||
run: |
|
||||
cd ${{ matrix.project }}
|
||||
TAG_NAME=$(make release-tag-name)
|
||||
VERSION=$(nix develop .\#cliff -c make changelog-next-version)
|
||||
if git tag | grep -q "${{ matrix.project }}@$VERSION"; then
|
||||
echo "Tag ${{ matrix.project }}/$VERSION already exists, skipping release preparation"
|
||||
if git tag | grep -q "$TAG_NAME@$VERSION"; then
|
||||
echo "Tag $TAG_NAME@$VERSION already exists, skipping release preparation"
|
||||
else
|
||||
echo "Tag does not exist, proceeding with release preparation"
|
||||
echo "Tag $TAG_NAME@$VERSION does not exist, proceeding with release preparation"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user