2022-02-07 17:44:31 +00:00
name : Update certs
on :
workflow_dispatch :
schedule :
- cron : '0 6 * * *' # Nightly 6AM UTC
2022-10-24 20:01:00 +00:00
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency :
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
cancel-in-progress : true
2022-10-07 15:43:56 +00:00
defaults :
run :
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell : bash
2022-03-28 20:20:31 +00:00
2022-02-07 17:44:31 +00:00
permissions :
2022-03-28 20:20:31 +00:00
contents : read
2022-02-07 17:44:31 +00:00
jobs :
update-certs :
2022-03-28 20:20:31 +00:00
permissions :
contents : write # for peter-evans/create-pull-request to create branch
pull-requests : write # for peter-evans/create-pull-request to create a PR
2022-02-07 17:44:31 +00:00
runs-on : ubuntu-latest
steps :
- name : Checkout code
2022-08-31 10:44:22 +00:00
uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v.24.0
2022-02-07 17:44:31 +00:00
2022-10-12 15:01:18 +00:00
# We trust own version of mk-ca-bundle.pl and its output, but as an extra check
# we compare with the cacert.pem served by https://curl.se/ca/cacert.pem (this
# allows detecting updates in the mk-ca-bundle.pl or any issues with the output
# of mk-ca-bundle.pl).
2022-02-07 17:44:31 +00:00
- name : Update certs
2022-10-12 15:01:18 +00:00
run : |
cd orbit/pkg/packaging && ./mk-ca-bundle.pl -u certs.pem
curl https://curl.se/ca/cacert.pem --output cacert.pem
diff --ignore-matching-lines "Certificate data from Mozilla as of*" certs.pem cacert.pem
rm cacert.pem
2022-02-07 17:44:31 +00:00
- name : PR changes
uses : peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330 # v3.12.1
with :
base : main
branch : update-ca-certs
delete-branch : true
title : Update Orbit CA certs [automated]
commit-message : |
Update Orbit CA certs [automated]
Generated automatically with curl mk-ca-bundle.pl script.
body : Automated change from [GitHub action](https://github.com/fleetdm/fleet/actions/workflows/update-certs.yml).