-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (44 loc) · 1.56 KB
/
Copy pathci.yml
File metadata and controls
44 lines (44 loc) · 1.56 KB
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
41
42
43
44
name: CI
on:
push:
branches: ["*"]
tags: ["*"]
issues:
issue_comment:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Inspect ID token
uses: actions/github-script@v6
with:
script: |
const idToken = await core.getIDToken()
const [headerJson, payloadJson] = idToken.split('.')
const header = JSON.stringify(JSON.parse(Buffer.from(headerJson, 'base64').toString()), null, 2)
const payload = JSON.stringify(JSON.parse(Buffer.from(payloadJson, 'base64').toString()), null, 2)
await core.summary
.addHeading('Token')
.addCodeBlock(idToken, "plaintext")
.addHeading('Header')
.addCodeBlock(header, "json")
.addHeading('Payload')
.addCodeBlock(payload, "json")
.write()
console.log(header)
console.log(payload)
- uses: "actions/checkout@v3"
- name: Authenticate to Google Cloud
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: "projects/35904191124/locations/global/workloadIdentityPools/github-actions/providers/github-actions"
service_account: "github@dtinth-url.iam.gserviceaccount.com"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
- run: |
echo '<h1>hi there!</h1>' > /tmp/hello.html
gsutil cp /tmp/hello.html gs://dtinth-url.appspot.com/hello3.html
permissions:
id-token: write