Skip to content

Create a GH issue when trusted root certs are outdated - #235

Merged
asgrim merged 3 commits into
php:mainfrom
asgrim:create-issue-when-trusted-root-outdated
May 6, 2025
Merged

Create a GH issue when trusted root certs are outdated#235
asgrim merged 3 commits into
php:mainfrom
asgrim:create-issue-when-trusted-root-outdated

Conversation

@asgrim

Copy link
Copy Markdown
Contributor

Fixes#212

@asgrimasgrim added this to the 0.11.0 milestone May 5, 2025
@asgrimasgrim self-assigned this May 5, 2025
@asgrimasgrim added the enhancement New feature or request label May 5, 2025
@asgrim
asgrim enabled auto-merge May 5, 2025 22:20
@asgrim
asgrim disabled auto-merge May 5, 2025 22:21
Comment thread.github/workflows/check-outdated-trusted-root.yml Outdated
Comment thread.github/workflows/check-outdated-trusted-root.yml Outdated
@asgrim
asgrim merged commit 5b24d98 into php:mainMay 6, 2025
@asgrim
asgrim deleted the create-issue-when-trusted-root-outdated branch May 6, 2025 20:57
schedule:
- cron: "0 0 * * *"

jobs:

@TimWollaTimWollaMay 6, 2025

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.

Missing permissions section: I believe all repositories in the php/* organization are configured with read-only GHA permissions by default. Thus this is unable to create the issue. You'll need:

permissions:
contents: read
issues: write

see: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks! Good catch, tested it on my own fork, but that doesn't have that restriction I think :) #237

@TimWollaTimWollaMay 6, 2025

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.

Quite possible. Organization-owned repositories behave a little differently. You can sync up the permissions here by switching to the second setting:

image

That would likely be at https://github.com/asgrim/pie/settings/actions

diff resources/trusted-root.jsonl resources/new-trusted-root.jsonl \
&& echo "Trusted root cert has not changed, no action required." \
|| ( \
(gh issue list | grep -i "Trusted root needs updating") \

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 think this might not work if too many open issues exist. This should not happen in practice, but perhaps you could make this a little smarter by leveraging the filter flags: https://cli.github.com/manual/gh_issue_list

Something: gh issue list --author "github-actions[bot]" might help. Or just create a dedicated label.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate maintenance of trusted roots

2 participants

@asgrim@TimWolla