Check for outdated trusted root certificates #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Check for outdated trusted root certificates" | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write # This permission is needed to create the issue | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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 --label "trusted-root-update" --state open | grep -i "Trusted root needs updating") \ | |
| && 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 \`diff -u <(jq < resources/trusted-root.jsonl) <(gh attestation trusted-root |jq)\` command to view the differences, and verify they are correct. | |
| * Use the \`gh attestation trusted-root > resources/trusted-root.jsonl\` command to update it, and make a new pull request with the updated file. | |
| The differences are also shown below: | |
| \`\`\`diff | |
| `diff -u <(jq < resources/trusted-root.jsonl) <(gh attestation trusted-root |jq)` | |
| \`\`\`" --assignee "asgrim" --label "trusted-root-update" \ | |
| ) |