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

Regular git warning causes build failure #1167

Closed
zml2008 opened this issue Jul 17, 2022 · 2 comments · Fixed by #1168
Closed

Regular git warning causes build failure #1167

zml2008 opened this issue Jul 17, 2022 · 2 comments · Fixed by #1168
Labels
bug 🐦 Something isn't working

Comments

@zml2008
Copy link

zml2008 commented Jul 17, 2022

Describe the bug

It seems like any output to stderr, including output that may be entirely normal, such as lines like

Warning: Permanently added the ECDSA host key for IP address '140.82.113.3' to the list of known hosts.

will cause this action to fail the actions build. The build should only be failed when the actual git operation fails.

Reproduction Steps

Unsure what exact conditions can trigger this issue -- but anything causing git to produce output on stderr without a push failure would trigger this issue

Logs

See
https://github.com/SpongePowered/math/runs/7374387288?check_suite_focus=true#step:11:59

Workflow

The relevant use of this action is:

      - name: Publish Javadoc
        if: "${{ runner.os == 'Linux' && ((env.STATUS != 'release' && inputs.publish_snapshot_javadoc && github.event_name == 'push' && steps.branch-name.outputs.match != '') || (env.STATUS == 'release' && github.event_name == 'release')) }}"
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: build/publish-jd
          ssh-key: "${{ secrets.SPONGE_JD_DEPLOY_KEY }}"
          repository-name: SpongePowered/APIJavadocs
          branch: data
          git-config-name: Spongie
          git-config-email: staff@spongepowered.org
          clean: false
          force: false
          commit-message: "Publishing javadoc for ${{ github.repository }} ${{ env.PROJECT_VERSION }}"

from a workflow shared across the organization

Additional Comments

n/a

@JamesIves
Copy link
Owner

JamesIves commented Jul 17, 2022

Thanks for reporting this. There's another similar issue reported here.

I've been trying to think what the best way to solve this is, as the rejection occurring here is potentially catching failures. @PartyLich handled it here in a fork, but this isn't a very scalable solution.

I'm wondering if we shouldn't throw an error in this case, but instead warn of a potential problem or filter for common scary words such as fatal: before throwing. From what I understand all fatal errors look something like fatal: Something went wrong... so it may be possible to just check if (!rejected && pushResult.stderr.includes('fatal:')) throw new Error(pushResult.stderr) or if (!rejected && pushResult.stderr.startsWith('fatal:')) throw new Error(pushResult.stderr)

@JamesIves JamesIves added bug 🐦 Something isn't working and removed triage ⚠️ labels Jul 17, 2022
@JamesIves
Copy link
Owner

I have a test version of this available here: JamesIves/github-pages-deploy-action@releases/v4-st if you'd like to try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐦 Something isn't working
Projects
None yet
2 participants