Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <[email protected]>
  • Loading branch information
imjasonh committed Jan 28, 2024
1 parent e2d03f9 commit 78e7302
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# `octo-sts`

This action federates the Github actions identity token for a Github App token
according to the Trust Policy in the target organization or repository.

## Usage

```yaml
permissions:
id-token: write # Needed to federate tokens.

steps:
- uses: chainguard-dev/actions/octo-sts@main
id: octo-sts
with:
# environment determines the environment from which to download the chainctl
# binary from.
# Optional (default is enforce.dev)
scope: your-org/your-repo

# identity holds the ID for the identity this workload should assume when
# speaking to Chainguard APIs.
identity: foo

- env:
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
run: |
gh repo list
```
The above will load a "trust policy" from `.github/chainguard/foo.sts.yaml` in
the repository `your-org/your-repo`. Suppose this contains the following, then
workflows in `my-org/my-repo` will receive a token with the specified
permissions on `my-org/my-repo`.

```yaml
issuer: https://token.actions.githubusercontent.com
subject: repo:my-org/my-repo:ref:refs/heads/main
permissions:
contents: read
issues: write
```

0 comments on commit 78e7302

Please sign in to comment.