Skip to content

Commit

Permalink
feat: add mask-token flag
Browse files Browse the repository at this point in the history
  • Loading branch information
flukolo4ek committed Nov 2, 2024
1 parent 3f9df62 commit bac9661
Show file tree
Hide file tree
Showing 7 changed files with 6,836 additions and 6,064 deletions.
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,44 @@ The action issues new Yandex Cloud IAM token and puts it in the output.
## Usage

```yaml
- name: IAM Token
id: issue-iam-token
uses: yc-actions/yc-iam-token@v1
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: IAM Token
id: issue-iam-token
uses: yc-actions/yc-iam-token@v1
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
```
`yc-sa-json-credentials` should contain JSON with authorized key for Service Account. More info in [Yandex Cloud IAM documentation](https://cloud.yandex.ru/docs/container-registry/operations/authentication#sa-json).

Alternative usage:



```yaml
- name: IAM Token
id: issue-iam-token
uses: yc-actions/yc-iam-token@v1
with:
yc-key-id: ${{ secrets.YC_KEY_ID }}
yc-service-account-id: ${{ secrets.YC_SERVICE_ACCOUNT_ID }}
yc-private-key: ${{ secrets.YC_PRIVATE_KEY }}
- name: IAM Token
id: issue-iam-token
uses: yc-actions/yc-iam-token@v1
with:
yc-key-id: ${{ secrets.YC_KEY_ID }}
yc-service-account-id: ${{ secrets.YC_SERVICE_ACCOUNT_ID }}
yc-private-key: ${{ secrets.YC_PRIVATE_KEY }}
```

`yc-key-id`, `yc-service-account-id` and `yc-private-key` are `id`, `service_account_id` and `private_key` respectively from Service Account json key.

### Action Inputs

| Name | Description | Default |
| ------------------------ | --------------------------------------------------------------------- | ------------------------------------- |
| `yc-sa-json-credentials` | Json containing authorized key for Service Account | ${{ secrets.YC_SA_JSON_CREDENTIALS }} |
| `yc-key-id` | "id" field from Service Account json key. | ${{ secrets.YC_KEY_ID }} |
| `yc-service-account-id` | "service_account_id" field from Service Account json key. | ${{ secrets.YC_SERVICE_ACCOUNT_ID }} |
| `yc-private-key` | "private_key" field from Service Account json key. | ${{ secrets.YC_PRIVATE_KEY }} |
| `mask-token` | Mask generated IAM token (use "false" for sharing token between jobs) | true |

### Action Outputs

See [action.yml](action.yml) for the full documentation for this action's inputs and outputs.
| Name | Description |
| ------- | ------------------- |
| `token` | Generated IAM token |

## Prerequisites

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
yc-private-key:
required: false
description: '"private_key" field from Service Account json key.'
mask-token:
required: false
description: 'Mask generated IAM token'
default: 'true'

outputs:
token:
Expand Down
Loading

0 comments on commit bac9661

Please sign in to comment.