Skip to content

Commit 7240c5a

Browse files
authored
fix: fix pr.yml issues and modify end quotes (#301)
1 parent 9876efc commit 7240c5a

File tree

2 files changed

+98
-11
lines changed

2 files changed

+98
-11
lines changed

.github/workflows/pr.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ jobs:
113113
# Track successful publications
114114
all_failed=true
115115
declare -a success_collections=()
116-
status_message='### Collection Publication Status
117-
'
116+
status_message="### Collection Publication Status"
118117
119118
for file in ${ADDED_FILES}; do
120119
echo $file
@@ -126,20 +125,18 @@ jobs:
126125
127126
response=$(python3 ./scripts/promote_collection.py "$file" "staging")
128127
echo "Processed file: $file"
129-
status_code=$(echo "$response" | jq -r '.statusCode')
128+
status_code=$(echo "$response" | jq -r '.statusCode' | head -n1)
130129
echo "Status Code: $status_code"
131130
132131
# Update status message based on response code
133-
if [ $status_code -eq 200 ] || [ $status_code -eq 201 ]; then
132+
if [[ $status_code -eq 200 ]] || [[ $status_code -eq 201 ]]; then
134133
echo "$collection_id successfully published ✅"
135-
status_message+="- **$collection_id**: Successfully published ✅
136-
"
134+
status_message+="- **$collection_id**: Successfully published ✅"
137135
success_collections+=("$file")
138136
all_failed=false
139137
else
140138
echo "$collection_id failed to publish ❌"
141-
status_message+="- **$collection_id**: Failed to publish. Error code $status_code. ❌
142-
"
139+
status_message+="- **$collection_id**: Failed to publish. Error code $status_code. ❌"
143140
fi
144141
else
145142
echo "File $file does not exist"
@@ -409,7 +406,7 @@ jobs:
409406
if: success()
410407
env:
411408
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
412-
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.commentId }}
409+
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.comment_id }}
413410
run: |
414411
PR_URL=${{ steps.create-pr.outputs.PR_URL }}
415412
CURRENT_BODY=$(gh api -H "Authorization: token $GITHUB_TOKEN" /repos/${{ github.repository }}/issues/comments/$COMMENT_ID --jq '.body')
@@ -422,7 +419,7 @@ jobs:
422419
if: failure() && steps.create-pr.outcome == 'failure'
423420
env:
424421
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
425-
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.commentId }}
422+
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.comment_id }}
426423
run: |
427424
CURRENT_BODY=$(gh api -H "Authorization: token $GITHUB_TOKEN" /repos/${{ github.repository }}/issues/comments/$COMMENT_ID --jq '.body')
428425
UPDATED_BODY="$CURRENT_BODY
@@ -435,7 +432,7 @@ jobs:
435432
if: failure() && steps.create-pr.outcome != 'failure'
436433
env:
437434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
438-
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.commentId }}
435+
COMMENT_ID: ${{ needs.publish-new-datasets.outputs.comment_id }}
439436
run: |
440437
WORKFLOW_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
441438
CURRENT_BODY=$(gh api -H "Authorization: token $GITHUB_TOKEN" /repos/${{ github.repository }}/issues/comments/$COMMENT_ID --jq '.body')
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"license": "CC0-1.0",
3+
"stac_version": "1.0.0",
4+
"links": [],
5+
"spatial_extent": {
6+
"xmin": -90.85,
7+
"ymin": 29.03,
8+
"xmax": -90.06,
9+
"ymax": 29.65
10+
},
11+
"temporal_extent": {
12+
"startdate": "2021-08-23T00:00:00.000Z",
13+
"enddate": "2021-09-09T23:59:59.000Z"
14+
},
15+
"discovery_items": [
16+
{
17+
"upload": false,
18+
"cogify": false,
19+
"dry_run": false,
20+
"filename_regex": "(.*)NDWI_Difference_(.*).tif$",
21+
"use_multithreading": false,
22+
"discovery": "s3",
23+
"prefix": "planet-indices-v2/",
24+
"bucket": "veda-data-store-staging"
25+
}
26+
],
27+
"sample_files": [
28+
"s3://veda-data-store-staging/planet-indices-v2/NDWI_Difference_2021-08-23_2021-09-09.tif"
29+
],
30+
"data_type": "cog",
31+
"stac_extensions": [
32+
"https://stac-extensions.github.io/render/v1.0.0/schema.json",
33+
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json"
34+
],
35+
"item_assets": {
36+
"cog_default": {
37+
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
38+
"roles": [
39+
"data",
40+
"layer"
41+
],
42+
"title": "Default COG Layer",
43+
"description": "Cloud optimized default layer to display on map"
44+
}
45+
},
46+
"providers": [
47+
{
48+
"name": "NASA VEDA",
49+
"roles": [
50+
"host"
51+
],
52+
"url": "https://www.earthdata.nasa.gov/dashboard/"
53+
}
54+
],
55+
"assets": {
56+
"thumbnail": {
57+
"title": "Thumbnail",
58+
"type": "image/jpeg",
59+
"roles": [
60+
"thumbnail"
61+
],
62+
"href": "https://thumbnails.openveda.cloud/louisiana-marsh.jpg",
63+
"description": "Photo by [Bridget Besaw](https://www.nature.org/en-us/get-involved/how-to-help/places-we-protect/the-nature-conservancy-in-louisiana-gulf-coast-prairies-and-marshes/) (Wetland landscape across southern Louisiana.)"
64+
}
65+
},
66+
"collection": "ida-ndwi-difference-TEST-DEBUG",
67+
"title": "NDWI Difference for Pre and Post-Hurricane Ida from PlanetScope TEST-DEBUG",
68+
"dashboard:time_density": "day",
69+
"description": "Normalized Difference Water Index Difference of before and after Hurricane Ida in Southern Louisiana.",
70+
"renders": {
71+
"dashboard": {
72+
"resampling": "nearest",
73+
"bidx": [
74+
1
75+
],
76+
"colormap_name": "rdbu",
77+
"assets": [
78+
"cog_default"
79+
],
80+
"rescale": [
81+
[
82+
-1,
83+
1
84+
]
85+
],
86+
"title": "VEDA Dashboard Render Parameters"
87+
}
88+
},
89+
"dashboard:is_periodic": true
90+
}

0 commit comments

Comments
 (0)