- TypeScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| action.yml | ||
| index.mts | ||
| README.md | ||
| x509hash.mts | ||
Install Certificate
A Forgejo Action that installs a CA certificate into the system trust store. Supports Alpine and Debian based runner images.
Usage
jobs:
example:
runs-on: docker
steps:
- uses: actions/install-cert@v1
with:
certificate: |
-----BEGIN CERTIFICATE-----
MIID...
-----END CERTIFICATE-----
Using the CA_CERTIFICATE environment variable instead:
jobs:
example:
runs-on: docker
env:
CA_CERTIFICATE: |
-----BEGIN CERTIFICATE-----
MIID...
-----END CERTIFICATE-----
steps:
- uses: actions/install-cert@v1
Inputs
| Name | Required | Description |
|---|---|---|
certificate |
no | PEM-encoded certificate. Falls back to CA_CERTIFICATE env var. |
Prerequisites
-
nodemust be available (included in all default Docker runner images). -
On Debian-based images the
ca-certificatespackage providesupdate-ca-certificates. On Alpine imagesca-certificates-bundle(providing/etc/ssl/certs/ca-certificates.crt) is sufficient; the fullca-certificatespackage is optional.
Notes
-
The certificate is written to
/usr/local/share/ca-certificates/proxy.crtand then activated. On Debian this runsupdate-ca-certificates. On images withoutupdate-ca-certificatesthe action creates the OpenSSL hash symlink in/etc/ssl/certs/and appends to the CA bundle, matching the same canonical encoding used by OpenSSL itself. -
The action fails with a clear error when no certificate is provided via either the input or the environment variable.
-
A basic PEM validity check is performed (presence of the
-----BEGIN CERTIFICATE-----marker).