Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add mask-token flag #490

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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