这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@robertkirkman
Copy link
Member

No description provided.

@robertkirkman robertkirkman force-pushed the auto-close-repository-health-check-issues branch from 2b6e8d5 to 71cb3aa Compare November 9, 2025 09:03
@robertkirkman robertkirkman force-pushed the auto-close-repository-health-check-issues branch 4 times, most recently from 9e5c9a1 to 2f6e9ea Compare November 9, 2025 09:20
@robertkirkman robertkirkman changed the title feat(ci): Automatically close old "Repository Health Check Failed" issues before opening new ones feat(ci): Automatically close the previous "Repository Health Check Failed" issue before opening the new one Nov 9, 2025
owokitty added a commit to owokitty/termux-packages that referenced this pull request Nov 9, 2025
owokitty added a commit to owokitty/termux-packages that referenced this pull request Nov 9, 2025
@robertkirkman
Copy link
Member Author

I ran a test in my fork repository on account @owokitty, which is visible in the GitHub links above, and it does successfully detect my placeholder test "Repository Health Check Failed" issue in my fork,

however, unfortunately I wasn't able to complete a full test of detecting and also closing the issue, because when it got to the part of the script where gh issue close is used, this error occurred:

image

I'm assuming that this error occurs because my fork doesn't have access to the real @termuxbot2 and the real repository to test with, so it doesn't have the GitHub permission to close its own issues like that because my fork repository isn't the same as the real repository.

I don't know if there's any way to test whether the same error would occur when attempting to use gh issue close on the real repository or not, without actually deploying this and allowing it to run.

At the very least, my test has confirmed (I think) that the correct issue gets detected by the gh issue list | jq command, so if allowed to run, it wouldn't attempt to close any unexpected issues, and would only attempt to close the issue that it's intended to close.

@robertkirkman robertkirkman force-pushed the auto-close-repository-health-check-issues branch from 2f6e9ea to 2848402 Compare November 9, 2025 09:45
@robertkirkman robertkirkman marked this pull request as ready for review November 9, 2025 09:46
owokitty added a commit to owokitty/termux-packages that referenced this pull request Nov 9, 2025
@robertkirkman robertkirkman force-pushed the auto-close-repository-health-check-issues branch from 2848402 to 1a12af3 Compare November 9, 2025 09:56
./scripts/check-repository-health.js "${{ steps.generate-apt-packages-list.outputs.OUTPUT_DIR }}" | tee repository-health.txt
- name: Create issue if health check fails
env:
GITHUB_TOKEN: ${{ secrets.TERMUXBOT2_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

We are not using github runner's github token. So setting the permissions above makes no change at all. @Grimler91 does have control of the @termuxbot2, so you'll have to ask him about whether the user does have permissions for closing issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for checking, I wasn't sure what the correct way to set the permissions was. I'll wait for Grimler to review this so that we know whether closing issues automatically is allowed (I don't think there has ever been a workflow that automatically closes issues here before).

Copy link
Member

@Grimler91 Grimler91 Nov 18, 2025

Choose a reason for hiding this comment

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

termuxbot2 has write access to termux-packages, which includes "can manage issues and pull requests", and its token includes public_repo scope, so it should be able to close issues

@robertkirkman robertkirkman marked this pull request as draft November 10, 2025 14:00
@robertkirkman robertkirkman force-pushed the auto-close-repository-health-check-issues branch from 1a12af3 to ff493ab Compare November 10, 2025 14:13
@robertkirkman robertkirkman marked this pull request as ready for review November 10, 2025 14:17
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.

4 participants