Skip to content

versus workflows: Update existing PR if any instead of closing/opening#240

Merged
thc202 merged 2 commits intozapbot:masterfrom
kingthorin:pr-update
Apr 16, 2026
Merged

versus workflows: Update existing PR if any instead of closing/opening#240
thc202 merged 2 commits intozapbot:masterfrom
kingthorin:pr-update

Conversation

@kingthorin
Copy link
Copy Markdown
Collaborator

Similar to the recent auth-tests addition.

@thc202
Copy link
Copy Markdown
Collaborator

thc202 commented May 21, 2025

This will not work as intended, the step # Update to the latest upstream needs to be changed as well, pushing the same content as the upstream is what closes the PR.

I'd also prefer that we don't fail the workflow when the PR is just being updated, there's no reason to and just creates noise (still getting one each day).

@kingthorin
Copy link
Copy Markdown
Collaborator Author

I'll look at the first point.
For the failures:

          gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
          gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill && true

(or ;; true)

@kingthorin
Copy link
Copy Markdown
Collaborator Author

I updated the juiceshop workflow, does that address your first concern?

@kingthorin kingthorin force-pushed the pr-update branch 2 times, most recently from 6d6604a to 9e5b266 Compare May 21, 2025 12:54
@thc202
Copy link
Copy Markdown
Collaborator

thc202 commented May 26, 2025

Seems so, it's no longer pushing the latest from upstream.

@kingthorin
Copy link
Copy Markdown
Collaborator Author

And which option for the failures or do you have another idea?

@thc202
Copy link
Copy Markdown
Collaborator

thc202 commented May 27, 2025

I don't mind which way as long as it only fails if there's an actual failure (to create the PR or push the changes).

@kingthorin
Copy link
Copy Markdown
Collaborator Author

In that case it would require something more like exit code logic, but I'm not sure they get specific enough.

For the time being, let's narrow this PR down to adjusting the PR logic in other workflows. Then I can look at the failure logic in another?

@thc202
Copy link
Copy Markdown
Collaborator

thc202 commented Jun 4, 2025

I'm fine with that, there aren't other ongoing PRs so failures should be minimal.

@kingthorin
Copy link
Copy Markdown
Collaborator Author

All adjusted.

@kingthorin kingthorin mentioned this pull request Aug 8, 2025
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates multiple GitHub Actions workflows that publish scan/auth results to zaproxy/zaproxy-website so repeated runs update the same branch/PR rather than creating new PRs each time.

Changes:

  • Removes the explicit “sync fork branch to upstream/main” steps from the zap-vs-* workflows.
  • Pushes results to a fixed branch name with force push and attempts gh pr create --fill, ignoring failures (intended to no-op when the PR already exists).
  • Aligns auth-tests.yml PR creation behavior with the “attempt create, ignore failure” approach.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
.github/workflows/zap-vs-webseclab.yml Updates PR-raising step to force-push a fixed branch and attempt PR creation without failing if it already exists.
.github/workflows/zap-vs-wavsep.yml Same PR update behavior for wavsep results.
.github/workflows/zap-vs-ssti.yml Same PR update behavior for SSTI results.
.github/workflows/zap-vs-owasp-benchmark.yml Same PR update behavior for OWASP Benchmark results.
.github/workflows/zap-vs-juiceshop.yml Same PR update behavior for Juice Shop results.
.github/workflows/zap-vs-firingrange.yml Same PR update behavior for Firing Range results.
.github/workflows/zap-vs-crawlmaze.yml Same PR update behavior for Crawl Maze results.
.github/workflows/auth-tests.yml Switches to `gh pr create --fill

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/zap-vs-ssti.yml
Comment thread .github/workflows/zap-vs-juiceshop.yml
Comment thread .github/workflows/zap-vs-crawlmaze.yml
Comment thread .github/workflows/auth-tests.yml
Comment thread .github/workflows/zap-vs-ssti.yml
Comment thread .github/workflows/zap-vs-webseclab.yml Outdated
Comment thread .github/workflows/zap-vs-owasp-benchmark.yml
Comment thread .github/workflows/zap-vs-juiceshop.yml
Comment thread .github/workflows/zap-vs-firingrange.yml
Comment thread .github/workflows/zap-vs-wavsep.yml
@kingthorin kingthorin force-pushed the pr-update branch 3 times, most recently from 4ba6ebe to e44c20c Compare April 16, 2026 14:01
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@thc202 thc202 merged commit df9c0be into zapbot:master Apr 16, 2026
@thc202
Copy link
Copy Markdown
Collaborator

thc202 commented Apr 16, 2026

Thank you!

@kingthorin kingthorin deleted the pr-update branch April 16, 2026 14:28
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

Successfully merging this pull request may close these issues.

3 participants