generated from sknups/github-action-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
40 lines (34 loc) · 1.26 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
name: 'Authenticate Google Artifact Registry'
description: 'Allows use of private npm repositories in Google Artifact Registry.'
inputs:
workload_identity_provider:
description: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
required: true
service_account:
description: 'my-service-account@my-project.iam.gserviceaccount.com'
required: true
erase_credentials:
description: 'Prevent subsequent steps being authenticated with Google Cloud'
required: false
default: 'false'
runs:
using: 'composite'
steps:
- name: Authenticate Google Cloud
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ inputs.workload_identity_provider }}
service_account: ${{ inputs.service_account }}
create_credentials_file: true
cleanup_credentials: true
- name: Authenticate Artifact Registry
shell: bash
run: npx --yes google-artifactregistry-auth@latest
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}
- name: Erase credentials file
if: ${{ inputs.erase_credentials == 'true' }}
shell: bash
run: rm ${{ steps.auth.outputs.credentials_file_path }}