Skip to content

fix(scripts/lint-packages): use package directory for version diff check - #26750

Merged
TomJo2000 merged 1 commit into
termux:masterfrom
TomJo2000:2lint2furious
Oct 2, 2025
Merged

fix(scripts/lint-packages): use package directory for version diff check#26750
TomJo2000 merged 1 commit into
termux:masterfrom
TomJo2000:2lint2furious

Conversation

@TomJo2000

Copy link
Copy Markdown
Member

and try to work out the issue causing git merge-base to not find the base commit of a PR branch.

- also use package directory instead of build.sh for version diff check
@robertkirkman
robertkirkman self-requested a review October 2, 2025 19:22
owokitty added a commit to owokitty/termux-packages that referenced this pull request Oct 2, 2025
@owokitty owokitty mentioned this pull request Oct 2, 2025

@robertkirkman robertkirkman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested this in

I think this is working.

@TomJo2000

TomJo2000 commented Oct 2, 2025

Copy link
Copy Markdown
Member Author

I did a similar test above (based on #26744's initial issue) but I had already cleaned up the commits on this branch.
https://github.com/termux/termux-packages/actions/runs/18201628698/job/51821761405?pr=26750#step:5:26

@TomJo2000
TomJo2000 merged commit f7f0300 into termux:master Oct 2, 2025
2 checks passed
@TomJo2000
TomJo2000 deleted the 2lint2furious branch October 2, 2025 19:36
@robertkirkman

Copy link
Copy Markdown
Member

I was testing what would happen if the name of the PR branch was "master", but I didn't see anything wrong happen as far as I can tell.

@TomJo2000

TomJo2000 commented Oct 2, 2025

Copy link
Copy Markdown
Member Author

Ah yeah that makes sense.
That's accounted for since we're reading .git/refs/remotes/origin/master.
Whereas the PR's branch is at .git/refs/remotes/pull/${PR_number}.
And local master is at .git/refs/heads/master.

@robertkirkman

Copy link
Copy Markdown
Member

I have determined in wild (downstream project's GitHub Actions CI) that this change has a dependency on this line, because this line uses git fetch origin master. After this change, if this lint-packages.sh is ever used in a CI workflow that was in a PR but did not have git fetch origin master already somewhere in it, there will be an error.

if [[ "${{ github.event_name }}" == "pull_request" && -n "$(git rev-list --merges "$(git fetch origin master >&2; git merge-base origin/master $HEAD_COMMIT)..$HEAD_COMMIT")" ]]; then

maybe that's not very important, since official termux-packages CI has that line, but I thought it important to write this note in case this change confuses anyone else or anyone else encounters the problem.

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.

2 participants