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

helmfile-stderr logs a generic message #267

Open
abseht opened this issue Apr 19, 2024 · 5 comments
Open

helmfile-stderr logs a generic message #267

abseht opened this issue Apr 19, 2024 · 5 comments

Comments

@abseht
Copy link

abseht commented Apr 19, 2024

Excerpt of my workflow

      - name: Run Helmfile Diff 📝
        id: helmfile_diff
        if: github.event_name == 'pull_request'
        uses: helmfile/[email protected]
        with:
          helmfile-version: "v0.160.0"
          helm-version: "v3.14.2"
          helmfile-workdirectory: "./charts"
          helm-plugins: >
            https://github.com/databus23/helm-diff
          helmfile-args: diff --environment development

      - name: PR Comment 💬
        if: github.event_name == 'pull_request' && (contains(steps.helmfile_diff.outputs.helmfile-stdout, 'has been removed') || contains(steps.helmfile_diff.outputs.helmfile-stdout, 'has been added') || contains(steps.helmfile_diff.outputs.helmfile-stdout, 'has changed') || steps.helmfile_diff.outputs.helmfile-stderr != '')
        uses: actions/github-script@v7
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          script: |
            const output = `
            #### Helmfile Diff Results for Development ♠️
            <details><summary>Helm Diff Output</summary>

            \`\`\`
            Output
            ${{ steps.helmfile_diff.outputs.helmfile-stdout }}
            Errors (if any)
            ${{ steps.helmfile_diff.outputs.helmfile-stderr }}
            \`\`\`

            </details>`;

            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: output
            })

As you see, I do not expect the message if specified strings are not found and stderr is empty.
However, I get comment as below (result from Actions logs)

Run actions/github-script@v7
  with:
    script: const output = `
  #### Helmfile Diff Results for Development ♠️
  <details><summary>Helm Diff Output</summary>
  
  \`\`\`
  Output
  Comparing release=secret-creator, chart=secret-creator
  
  Errors (if any)
  Building dependency release=secret-creator, chart=secret-creator
  
  \`\`\`
  
  </details>`;
  
  github.rest.issues.createComment({
    issue_number: context.issue.number,
    owner: context.repo.owner,
    repo: context.repo.repo,
    body: output
  })

Expected:
No generic messages in stderr.
Thank you for considering the issue.

@yxxhero
Copy link
Member

yxxhero commented Apr 20, 2024

@abseht Do you wish helmfile diff return empty when no diff?

@abseht
Copy link
Author

abseht commented Apr 22, 2024

@yxxhero i think it is fair to return some message as "...nothing to apply..." and people will use it as they please.

@yxxhero
Copy link
Member

yxxhero commented May 5, 2024

@abseht yeah. you can post an feature request in helmd-diff project.

@abseht
Copy link
Author

abseht commented May 6, 2024

@yxxhero this issue is about not logging 'stderr' if there is no errors.

@yxxhero
Copy link
Member

yxxhero commented May 7, 2024

ok

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