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

Action fails due to argument passed to --drop-prefix #8

Open
sirajissani opened this issue Dec 14, 2023 · 7 comments
Open

Action fails due to argument passed to --drop-prefix #8

sirajissani opened this issue Dec 14, 2023 · 7 comments

Comments

@sirajissani
Copy link

sirajissani commented Dec 14, 2023

The action fails with the following top level message on GitHub CI.
The issue is observed 0.3.11 as well as 0.4.0.
However the issue is fixed on the main branch - that is @main works

    uses: choffmeister/git-describe-semver@main
Github Action Logs

Run choffmeister/[email protected]
  with:
    fallback: 0.0.0
    prerelease-prefix: pre
    prerelease-timestamped: false
    version: latest
    dir: .
    drop-prefix: false
Run cd /tmp
  cd /tmp
  URL=$(curl -fsSL https://api.github.com/repos/choffmeister/git-describe-semver/releases/latest | jq -r '.assets[] | select(.name|test("linux_amd64\\.tar\\.gz$")) | .browser_download_url')
  curl -fsSL "$URL" | tar xz
  mv git-describe-semver /usr/local/bin
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
Run git-describe-semver \
  git-describe-semver \
    --dir="." \
    --fallback="0.0.0" \
    --drop-prefix="false" \
    --prerelease-prefix="pre" \
    --prerelease-suffix="" \
    --prerelease-timestamped="false" \
     \
    --format="version=<version>" \
    $GITHUB_OUTPUT
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
bool flag `--drop-prefix' cannot have an argument
Error: Process completed with exit code 1.

The workflow job is as follows

jobs:
  get_version:
    name: Get Build Version
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          submodules: 'true'
          fetch-depth: 0
          set-safe-directory: 'true'

      - id: git_describe_semver
        uses: choffmeister/[email protected]
        with:
          fallback: 0.0.0
          prerelease-prefix: pre
          prerelease-suffix: ''
          prerelease-timestamped: false

Could you please tag this release so that I could refer to it specifically. Also, it was a surprise that a later commit broke 0.3.11. Perhaps the action always pulls the latest docker image. Any help for this would be greatly appreciated.

@atc0005
Copy link

atc0005 commented Dec 15, 2023

@choffmeister I get the same results when updating to v0.4.0 (via Dependabot PR).

Is this unintentional, or should users of the action refrain from specifying explicit false values for settings?

This is how I have the action configured in one of my projects for the v0.3.11 release:

        uses: choffmeister/[email protected]
        with:
          fallback: v0.0.0
          drop-prefix: false
          prerelease-prefix: dev
          prerelease-suffix: ""
          prerelease-timestamped: false

Updating it to this configuration breaks CI:

        uses: choffmeister/[email protected]
        with:
          fallback: v0.0.0
          drop-prefix: false
          prerelease-prefix: dev
          prerelease-suffix: ""
          prerelease-timestamped: false

with the same message that @sirajissani reported:

bool flag `--drop-prefix' cannot have an argument

@sirajissani
Copy link
Author

@atc0005 does it work for you if you were to rollback to @0.3.11? For me, it failed even without bumping the version used in the CI job. However, do note that @master fixes the pipeline for now. You can also check the changes to action.yaml in bc76515.

@atc0005
Copy link

atc0005 commented Dec 26, 2023

@sirajissani I have the version pinned to what I believe is v0.3.11 and it works (going from memory, responding quickly via mobile).

Dependabot offered the latest version which failed to pass CI, so I did not accept the version bump.

@sirajissani
Copy link
Author

@atc0005 I just checked your recently run actions and they do fail exactly as mine even with v0.3.11.

@atc0005
Copy link

atc0005 commented Jan 11, 2024

@sirajissani Thanks for checking.

I thought I remembered otherwise, but as you noted when I looked back at the earlier logs I see that you are correct.

From your updated original post:

Also, it was a surprise that a later commit broke 0.3.11. Perhaps the action always pulls the latest docker image.

This appears to be the case.

This is recorded in the logs for a recent CI job (https://github.com/atc0005/go-ci/actions/runs/7472502581/job/20334831671#step:7:8):

Run choffmeister/[email protected]
Run docker://ghcr.io/choffmeister/git-describe-semver:latest

with the same result:

bool flag `--drop-prefix' cannot have an argument

The ghcr.io/choffmeister/git-describe-semver:latest image (https://github.com/choffmeister/git-describe-semver/pkgs/container/git-describe-semver/156253338?tag=0.4.0) appears to be used instead of the expected v0.3.11 (https://github.com/choffmeister/git-describe-semver/pkgs/container/git-describe-semver/93675714?tag=0.3.11) image.

@choffmeister would it be useful if we filed a separate GH issue for the Docker tags issue noted above?

@atc0005
Copy link

atc0005 commented Jan 12, 2024

@sirajissani Potentially related:

If understand the changes between v0.3.11 and v0.4.0 correctly, then the flag package was swapped out and the new one does not support explicitly setting a boolean flag as false.

@atc0005
Copy link

atc0005 commented Jan 13, 2024

@sirajissani

If you want to stick with v0.3.11, try this:

      - id: git_describe_semver
        uses: choffmeister/[email protected] # version of the action
        with:
          fallback: 0.0.0
          prerelease-prefix: pre
          prerelease-suffix: ''
          prerelease-timestamped: false
          version: v0.3.11 # version of the tool

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