Skip to content

Commit

Permalink
Merge pull request #44 from NixOS/fix-update-html
Browse files Browse the repository at this point in the history
Fix output markdown of update-github-actions
  • Loading branch information
philiptaron authored Apr 15, 2024
2 parents 52ed7c5 + e799c53 commit 62d820f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions scripts/update-github-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ job:
- "*"
EOF

if ! create_pull_request=$(LOCAL_GITHUB_ACCESS_TOKEN="$githubToken" \
if create_pull_request=$(LOCAL_GITHUB_ACCESS_TOKEN="$githubToken" \
dependabot update --file "$tmp/input.yml" --local "$REPO_ROOT" \
| jq --exit-status 'select(.type == "create_pull_request").data'); then
# Nothing to update
exit 0
fi

jq --exit-status --raw-output '."pr-body"' <<< "$create_pull_request"
jq --exit-status --raw-output '."pr-body"' <<< "$create_pull_request"

echo '</details>'
jq --compact-output '."updated-dependency-files"[]' <<< "$create_pull_request" \
| while read -r fileUpdate; do
file=$(jq --exit-status --raw-output '.name' <<< "$fileUpdate")
# --join-output makes sure to not output a trailing newline
jq --exit-status --raw-output --join-output '.content' <<< "$fileUpdate" > "$REPO_ROOT/$file"
done
fi

jq --compact-output '."updated-dependency-files"[]' <<< "$create_pull_request" \
| while read -r fileUpdate; do
file=$(jq --exit-status --raw-output '.name' <<< "$fileUpdate")
# --join-output makes sure to not output a trailing newline
jq --exit-status --raw-output --join-output '.content' <<< "$fileUpdate" > "$REPO_ROOT/$file"
done
echo '</details>'

0 comments on commit 62d820f

Please sign in to comment.