Skip to content

chore/automatic semver [CLI-1465]#615

Open
octavian-snyk wants to merge 2 commits into
mainfrom
chore/CLI-1465_automatic-semver
Open

chore/automatic semver [CLI-1465]#615
octavian-snyk wants to merge 2 commits into
mainfrom
chore/CLI-1465_automatic-semver

Conversation

@octavian-snyk
Copy link
Copy Markdown

@octavian-snyk octavian-snyk commented May 25, 2026

Description

This PR introduces SemVer release tagging workflow for this repo.

Note: When this PR is merged, the repository will bump to version: v1.0.0.

@octavian-snyk octavian-snyk requested review from a team as code owners May 25, 2026 11:31
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 25, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 25, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-pr-review-bot

This comment has been minimized.

Comment thread CONTRIBUTING.md
Comment on lines +300 to +303
# Creating commits

Commits must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) structure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the CLI's CONTRIBUTING.md also says about Writing commit messages, by specifying "what" rather than "how". Maybe is worth saying it here as well.

Comment on lines +15 to +23
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ github.ref_name }}
minorList: feat, revert
patchList: fix
noVersionBumpBehavior: silent
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in code-client-go the config is:

     - name: Get Next Version
        id: semver
        uses: ietf-tools/semver-action@v1
        with:
          token: ${{ github.token }}
          branch: main
          noVersionBumpBehavior: patch

here fixes branch to main instead getting ref_name, and noVersionBumpBehavior sets to patch.
Are we sure about not following the pattern that has in code-client-go?

Comment thread .github/workflows/release.yml Outdated
Comment on lines +25 to +29
- name: Create tag and Push tag
if: ${{ steps.semver.outputs.next != '' }}
run: |
git tag ${{ steps.semver.outputs.next }}
git push origin ${{ steps.semver.outputs.next }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe have separate steps for creating tag and then pushing?
ref: https://github.com/snyk/code-client-go/blob/main/.github/workflows/release.yml

Comment thread CONTRIBUTING.md
| docs | Changes to documentation for existing features. | none |
| chore | Build, workflow and pipeline changes. | none |
| revert | Reverting a previous commit. | minor |
| BREAKING CHANGE | Commit message contains BREAKING CHANGE | major |
Copy link
Copy Markdown
Contributor

@danskmt danskmt May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this BREAKING CHANGE should be in this table as the others are defined at the beginning of the commit message, and BREAKING CHANGE is something that is probably in the commit's body description

Comment thread CONTRIBUTING.md

This runs the presenter tests with `UFM_REGEN=1`, which overwrites the expected files with the current presenter output and skips the comparison. The same effect can be achieved by flipping the `regenerateExpectedFiles` constant at the top of `internal/presenters/presenter_ufm_test.go` to `true` and running the tests directly (handy when stepping through with a debugger). Review the diff before committing.

# Creating commits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is not the main header. Maybe ## or ###?

@octavian-snyk octavian-snyk force-pushed the chore/CLI-1465_automatic-semver branch from 330966d to 7ec77c2 Compare May 26, 2026 06:59
@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Invalid Action Version 🔴 [critical]

The workflow references actions/checkout@v6. As noted in the triage hypotheses, the current standard is v4 and v6 does not exist. This will cause the workflow to fail to load, preventing any releases from occurring.

- uses: actions/checkout@v6
Insufficient Permissions 🟠 [major]

The workflow attempts to push a git tag and create a GitHub release but does not declare permissions: contents: write. Default GitHub Actions tokens are often restricted to read-only access. Without this explicit permission block, both the git push and gh release create steps will fail with authentication errors.

  run: git push origin ${{ steps.semver.outputs.next }}

- name: Release
  if: ${{ steps.semver.outputs.next != '' }}
  run: gh release create ${{ steps.semver.outputs.next }} --generate-notes
📚 Repository Context Analyzed

This review considered 7 relevant code sections from 4 files (average relevance: 0.61)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants