File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 26
26
- name : Update metadata
27
27
run : |
28
28
./scripts/update-release-metadata.py sigsci-module-golang ${{ github.ref }}
29
+ env :
30
+ PROD_ID : ${{ secrets.SIGSCI_PROD_CANONICAL_ID }}
31
+
Original file line number Diff line number Diff line change 3
3
import sys
4
4
import boto3
5
5
import re
6
+ import os
6
7
7
8
8
9
def fetch_metadata ():
@@ -26,11 +27,16 @@ def write_metadata(data):
26
27
'''
27
28
Write metadata file from byte stream.
28
29
'''
30
+ prod_canonical_id = os .environ .get ("PROD_ID" )
31
+ if not prod_canonical_id :
32
+ sys .stderr .write ('Cannot find production account ID. Exiting.\n ' )
33
+ return 1
29
34
client = boto3 .client ('s3' )
30
35
resp = client .put_object (
31
36
Body = data ,
32
37
Bucket = 'release-metadata' ,
33
- Key = 'release-versions'
38
+ Key = 'release-versions' ,
39
+ GrantFullControl = prod_canonical_id
34
40
)
35
41
36
42
if resp .ResponseMetadata .HTTPStatusCode != 200 :
@@ -40,6 +46,7 @@ def write_metadata(data):
40
46
41
47
42
48
def main (module_name , new_ref ):
49
+
43
50
if not new_ref .startswith ('refs/tags/' ):
44
51
sys .stderr .write (
45
52
f'Unknown reference format { new_ref } . Expecting refs/tags/v<version>\n ' )
You can’t perform that action at this time.
0 commit comments