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

fix(ci): standardize array variable passed thru publish actions #218

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 5 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,17 @@ jobs:

# Track successful publications
all_failed=true
success_collections=()
declare -a success_collections=()
status_message='### Collection Publication Status
'

for file in "${ADDED_FILES[@]}"; do
for file in "${ADDED_FILES}"; do
echo $file
if [ -f "$file" ]; then
dataset_config=$(jq '.' "$file")
collection_id=$(jq -r '.collection' "$file")

echo "Publishing $collection_id"
response=$(curl -s -w "%{http_code}" -o response.txt -X POST "$publish_url" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AUTH_TOKEN" \
Expand Down Expand Up @@ -171,7 +172,7 @@ jobs:
fi

# Output only successful collections to be used in subsequent steps
echo "success_collections=$(IFS=','; echo "${success_collections[*]}")" >> $GITHUB_OUTPUT
echo "success_collections=${success_collections[*]}" >> $GITHUB_OUTPUT

# Update PR comment
CURRENT_BODY=$(gh api -H "Authorization: token $GITHUB_TOKEN" /repos/${{ github.repository }}/issues/comments/$COMMENT_ID --jq '.body')
Expand Down Expand Up @@ -221,8 +222,7 @@ jobs:
run: |
echo $PUBLISHED_COLLECTION_FILES
pip install -r ./scripts/requirements.txt
for file in "${PUBLISHED_COLLECTION_FILES[@]}"
do
for file in ${PUBLISHED_COLLECTION_FILES}; do
python3 ./scripts/generate-mdx.py "$file"
done

Expand Down
Loading