-
Notifications
You must be signed in to change notification settings - Fork 55
Create a GH issue when trusted root certs are outdated #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: "Check for outdated trusted root certificates" | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Pull new trusted root | ||
| run: gh attestation trusted-root > resources/new-trusted-root.jsonl | ||
| - name: Create an issue if different | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| 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") \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: |
||
| && echo "Issue to update trusted root already exists, no action required." \ | ||
| || gh issue create --title "Trusted root needs updating" --body "The trusted root certificate file needs updating. Use the \`gh attestation trusted-root > resources/trusted-root.jsonl\` command to update it." --assignee "asgrim" \ | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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:
see: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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:
That would likely be at https://github.com/asgrim/pie/settings/actions