Skip to content

Commit

Permalink
ci: limit fetch product types action PR body length (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed May 5, 2023
1 parent 4c373fd commit bbd367a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/fetch.yml
Expand Up @@ -51,26 +51,27 @@ jobs:
git config user.email "'github-actions[bot]@users.noreply.github.com"
git add "${JSON_OUTPUT_FILE}"
git commit -m "fix: update external product types reference" || exit 0
echo "Update external product types reference from daily fetch. See [Python API User Guide / Product types discovery](https://eodag.readthedocs.io/en/latest/notebooks/api_user_guide/2_providers_products_available.html#Product-types-discovery)" >> $GITHUB_STEP_SUMMARY
echo '### Changed files' >> $GITHUB_STEP_SUMMARY
echo 'May be truncated.' >> $GITHUB_STEP_SUMMARY
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${COMMIT_SHA}"
echo "commit [${COMMIT_SHA}](${COMMIT_URL})" >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git show --name-only --format=tformat: >> $GITHUB_STEP_SUMMARY
(diff <(curl ${JSON_REF_FILE} | jq ) <(cat ${JSON_OUTPUT_FILE} | jq) || true) >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# truncated PR body (too long causes error)
full_update_summary=$(cat $GITHUB_STEP_SUMMARY)
echo 'UPDATE_SUMMARY<<EOF' >> $GITHUB_ENV
cat $GITHUB_STEP_SUMMARY >> $GITHUB_ENV
echo "${full_update_summary:0:65536}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: external-product-types-ref-update
delete-branch: true
title: 'fix: update external product types reference'
body: |
Update external product types reference from daily fetch. See
[Python API User Guide / Product types discovery](https://eodag.readthedocs.io/en/latest/notebooks/api_user_guide/2_providers_products_available.html#Product-types-discovery)
${{ env.UPDATE_SUMMARY }}
body: ${{ env.UPDATE_SUMMARY }}
labels: |
automated pr
2 changes: 1 addition & 1 deletion eodag/resources/ext_product_types.json

Large diffs are not rendered by default.

0 comments on commit bbd367a

Please sign in to comment.