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

How to make it fail on warning? #38

Open
Anoncheg1 opened this issue Dec 24, 2024 · 2 comments
Open

How to make it fail on warning? #38

Anoncheg1 opened this issue Dec 24, 2024 · 2 comments

Comments

@Anoncheg1
Copy link

Anoncheg1 commented Dec 24, 2024

That is how I use it:
https://github.com/Anoncheg1/selected-window-contrast/blob/main/.github/workflows/melpazoid.yml

env:
          LOCAL_REPO: ${{ github.workspace }}
          # RECIPE is your recipe as written for MELPA:
          RECIPE: (selected-window-contrast :fetcher github :repo "Anoncheg1/selected-window-contrast")
          # set this to false (or remove it) if the package isn't on MELPA:
          # EXIST_OK: false
        run: echo $GITHUB_REF && make -C ~/melpazoid

What should I set to make it error at any warning and crash Github Action run?

What customizations are possible?

@riscy
Copy link
Owner

riscy commented Dec 24, 2024

What should I set to make it error at any warning and crash Github Action run?

Currently there's no support for this - here's the current logic.

But it would be a pretty easy code change to make warnings turn into CI build failures (maybe behind some flag). I could see this being useful and I can look at building that in.

@Anoncheg1
Copy link
Author

Workaround:

        run: |
          echo $GITHUB_REF
          if make -C ~/melpazoid |& tee output.log; then
            if grep -q "Warning" output.log; then
              echo "Warnings detected, failing workflow"
              exit 1
            fi
          else
            echo "Make command failed, failing workflow"
            exit 1
          fi

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