Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[error]failed to parse title: invalid semver #16

Closed
peterbe opened this issue Sep 10, 2020 · 7 comments
Closed

[error]failed to parse title: invalid semver #16

peterbe opened this issue Sep 10, 2020 · 7 comments

Comments

@peterbe
Copy link

peterbe commented Sep 10, 2020

mdn/yari#1231 failed because of this error:
Screen Shot 2020-09-10 at 7 12 16 AM
https://github.com/mdn/yari/pull/1231/checks?check_run_id=1094792761

Workflow here

@ahmadnassri
Copy link
Owner

"technically" this is correct behavior...

GitHub Actions uses the @* to identify versions using tags & branches ...

an action could point to @master for example, and dependabot is pushing PRs seemingly by "recency" rather than version increment...

ignoring for a second that this action is triggered on a pull request to update the action itself ... because it's getting too meta!

in this auto-merge action, v1 (which is the tagged version of an action) is not a valid semver, and therefore the logic to compare versions is not going to work, so it "soft fails" (all checks are green) and falls back to human intervention ...

I could squint my eyes and see a possibility of attempting to "fix" the version (v1 to v1.*.*) before comparing it...

but first I wanted to explain the workflow and show that's working as expected here without causing failures

@peterbe
Copy link
Author

peterbe commented Sep 10, 2020

Oh I see. It's a bit tricky because the "unexpected error" is being used as a form of "safe failure". Ideal would be a warning instead "##[warning] Incompatible semver versions. Can't compare, so needs human eyes" :)

This notation of uses: technote-space/get-diff-action@v3 appears to be very common on GitHub Actions but very rare on things like NPM or PyPI packages.

I'll leave it to you to "squint your eyes". But for now, I'll just merge mine :)

@ahmadnassri
Copy link
Owner

  • made the change to use warnings: 5bab4aa
  • yeah that notation was a pain to even get setup properly in releases .. see:
    alias:
    needs: release
    if: needs.release.outputs.published == 'true'
    runs-on: ubuntu-latest
    strategy:
    matrix:
    alias:
    - version: v${{ needs.release.outputs.release-version-major }}
    - version: v${{ needs.release.outputs.release-version-major }}.${{ needs.release.outputs.release-version-minor }}
    steps:
    - uses: actions/github-script@v2
    with:
    script: |
    const tag = 'tags/${{ matrix.alias.version }}'
    const repo = {
    owner: context.repo.owner,
    repo: context.repo.repo
    }
    await github.git.deleteRef({ ...repo, ref: tag }).catch(() => {})
    await github.git.createRef({ ...repo, ref: `refs/${tag}` , sha: process.env.GITHUB_SHA })

@ahmadnassri
Copy link
Owner

ahmadnassri commented Sep 10, 2020

as for your merging that PR, you can also just set it to v2 and ignore the minor/patch version specific PRs from dependabot for actions ....

unless you want those ...

@peterbe
Copy link
Author

peterbe commented Sep 11, 2020

I am so sorry for being a pain but...

I could understand how it could error on v1 -> v2.0.1 or something because 1 isn't a valid semver.
But what about this one:

title: "Bump ahmadnassri/action-dependabot-auto-merge from v2.0.1 to v2.0.4"
depName: ahmadnassri/action-dependabot-auto-merge
##[warning]failed to parse title: invalid semver

As seen here: https://github.com/mdn/yari/pull/1243/checks?check_run_id=1100241207

So meta! It's a PR to upgrade your/this action from 2.0.1 to 2.0.4.

@ahmadnassri
Copy link
Owner

ahmadnassri commented Sep 11, 2020

so very meta!

2.0.1 had a bug, and was fixed in v2.0.2 which addresses this semver parsing error

upgrade to latest (v2.0.4) or simply use v2 in your workflow: ahmadnassri/action-dependabot-auto-merge@v2 to use the latest within the same major

@peterbe
Copy link
Author

peterbe commented Sep 28, 2020

Still a bug in 2.0.4.
See https://github.com/mdn/yari/pull/1326/checks?check_run_id=1175038089

using workflow's "target": 
- match:
    dependency_type: all
    update_type: 'semver:minor'

title: "Bump ahmadnassri/action-dependabot-auto-merge from v2.0.4 to v2.1.1"
depName: ahmadnassri/action-dependabot-auto-merge
Warning: failed to parse title: invalid semver

It failed to upgrade from v2.0.4 to v2.1.1. Is it because of the little v prefix?

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

No branches or pull requests

2 participants