Skip to content

Commit

Permalink
open-pr: allow update-scripts to stage changes already
Browse files Browse the repository at this point in the history
The current logic calls for the `update-scripts` to leave uncommitted
changes. To be precise, it tests for _unstaged_ changes.

If an `update-scripts/versions/*` script already staged changes and did
not leave any unstaged changes around, the check would say:
"<package> already at <version>".

However, any new files need to be staged. Technically, we could stage
them via `git add -N`, but that would be only for the sake of
accommodating the current definition of the `open-pr` GitHub workflow,
when that workflow is just as easily improved instead.

So let's just enhance the check to look not only for unstaged changes,
but also for staged-yet-uncommitted changes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jul 8, 2024
1 parent d98d4f9 commit 90c2a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
PKGBUILD
fi &&
git update-index -q --refresh &&
if git diff-files --exit-code
if git diff-files --exit-code && git diff-index --quiet HEAD --
then
echo "::notice::$PACKAGE_TO_UPGRADE already at $UPGRADE_TO_VERSION"
exit 0
Expand Down

0 comments on commit 90c2a11

Please sign in to comment.