File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 55
66This repository contains GitHub Actions that are common to drivers.
77
8+ ## Secure Checkout
9+
10+ This action will perform a checkout with the GitHub App credentials.
11+
12+ ``` yaml
13+ - name : secure-checkout
14+ uses : mongodb-labs/drivers-github-tools/secure-checkout@v2
15+ with :
16+ app_id : ${{ vars.APP_ID }}
17+ private_key : ${{ secrets.APP_PRIVATE_KEY }}
18+ ` ` `
19+
20+ By default it will use the current ` ${{github.ref}}` if the `ref` parameter is
21+ not given. It will write the secure global variable `GH_TOKEN` that can be
22+ used with the `gh` cli.
23+
24+
825# # Setup
926
1027There is a common setup action that is meant to be run before all
Original file line number Diff line number Diff line change 1+ name : Secure Checkout
2+ description : Secure Checkout with GitHub App Credentials
3+ inputs :
4+ app_id :
5+ description : The ID of the GitHub app.
6+ required : true
7+ private_key :
8+ description : The private key of the GitHub app.
9+ required : true
10+ ref :
11+ description : The reference to check out
12+ default : ${{ github.ref }}
13+ fetch-depth :
14+ description : ' Number of commits to fetch. 0 indicates all history for all branches and tags.'
15+ default : " 1"
16+ submodules :
17+ description : >
18+ Whether to checkout submodules: `true` to checkout submodules or `recursive` to
19+ recursively checkout submodules.
20+ default : " false"
21+
22+ runs :
23+ using : composite
24+ steps :
25+ - name : Create temporary app token
26+ uses : actions/create-github-app-token@v1
27+ id : app-token
28+ with :
29+ app-id : ${{ inputs.app_id }}
30+ private-key : ${{ inputs.private_key }}
31+
32+ - name : Store GitHub token in environment
33+ run : echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
34+ shell : bash
35+
36+ - uses : actions/checkout@v4
37+ with :
38+ ref : ${{ inputs.ref }}
39+ token : ${{ env.GH_TOKEN }}
40+ fetch-depth : ${ {inputs.fetch-depth }}
41+ submodules : ${{ inputs.submodules }}
You can’t perform that action at this time.
0 commit comments