Skip to content

Commit e5bd985

Browse files
authored
Update readme with best practices (#89)
1 parent 40b8ff3 commit e5bd985

File tree

1 file changed

+47
-6
lines changed

1 file changed

+47
-6
lines changed

README.md

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,47 @@
55
66
This repository contains GitHub Actions that are common to drivers.
77

8-
## Secure Checkout
8+
## Working on Actions
9+
10+
Many of the actions in this repo depend on one another. There is no supported way to reference
11+
another action using a relative path. Therefore the recommended approach is to
12+
set all of the relative actions to your branch name while working on a feature,
13+
then reverting to the version tag before merging.
14+
15+
## Consuming Actions
16+
17+
It is recommended that you use Dependabot and use an explicit reference when
18+
using these actions. This will allow Dependabot to update to a more recent sha
19+
and allow you to accept updates to the actions as needed.
20+
21+
Example `dependabot.yml`:
22+
23+
```yaml
24+
version: 2
25+
updates:
26+
- package-ecosystem: "github-actions"
27+
directory: "/"
28+
schedule:
29+
interval: "weekly"
30+
groups:
31+
actions:
32+
patterns:
33+
- "*"
34+
```
35+
36+
Example usage with references:
37+
38+
```yaml
39+
- name: secure-checkout
40+
uses: mongodb-labs/drivers-github-tools/secure-checkout@40b8ff3c0decd1388587fcc3d0a36d4818a054a6 # v2
41+
with:
42+
app_id: ${{ vars.APP_ID }}
43+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
44+
```
45+
46+
## Basic Actions
47+
48+
### Secure Checkout
949
1050
This action will perform a checkout with the GitHub App credentials.
1151
@@ -21,8 +61,7 @@ By default it will use the current `${{github.ref}}` if the `ref` parameter is
2161
not given. It will write the secure global variable `GH_TOKEN` that can be
2262
used with the `gh` cli.
2363

24-
25-
## Setup
64+
### Setup
2665

2766
There is a common setup action that is meant to be run before all
2867
other actions. It handles fetching secrets from AWS Secrets Manager,
@@ -212,7 +251,9 @@ There are several ways to specify the security report:
212251
- By specifying a relative path, which is then linked to the corresponding git blob for the tagged version
213252
- By adding the `security-report-url` to the AWS Secrets Vault
214253

215-
## Full Report
254+
## Other Common Actions
255+
256+
### Full Report
216257

217258
This action is a convenience function to handle all of the SSDLC reports and put them
218259
in the `S3_ASSETS` folder. This composite action runs the `authorized-pub`, `sbom`, `code-scanning-export`, and `compliance-report` actions.
@@ -232,7 +273,7 @@ in the `S3_ASSETS` folder. This composite action runs the `authorized-pub`, `sbo
232273
dist_filenames: dist/*
233274
```
234275

235-
## Upload S3 assets
276+
### Upload S3 assets
236277

237278
A number of scripts create files in the `tmp/s3_assets` folder, which then can
238279
be uploaded to the product's S3 bucket:
@@ -255,7 +296,7 @@ By default, all files in the S3 directory are uploaded. When the `dry_run` input
255296
is set to anything other than `false`, no files are uploaded, but instead the
256297
filename along with the resulting location in the bucket is printed.
257298

258-
## Create Release Branch
299+
### Create Release Branch
259300

260301
Use this action to create a release branch and populate it with metadata.
261302
It will update ``EVERGREEN_PROJECT`` env variable

0 commit comments

Comments
 (0)