mirror of
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git
synced 2025-06-05 01:04:03 -04:00
Add a comment with new Flatpak packages list #2007
This commit is contained in:
parent
4152347cb8
commit
2b997a3f66
1 changed files with 26 additions and 1 deletions
|
@ -9,9 +9,14 @@ API_ENDPOINT="https://api.github.com/repos/PapirusDevelopmentTeam/papirus-icon-t
|
|||
unchecked_apps_list="$(mktemp -u)"
|
||||
completed_apps_list="$(mktemp -u)"
|
||||
missing_apps_list="$(mktemp -u)"
|
||||
new_apps_list="$(mktemp -u)"
|
||||
|
||||
_cleanup() {
|
||||
rm -f "$unchecked_apps_list" "$completed_apps_list" "$missing_apps_list"
|
||||
rm -f \
|
||||
"$unchecked_apps_list" \
|
||||
"$completed_apps_list" \
|
||||
"$missing_apps_list" \
|
||||
"$new_apps_list"
|
||||
}
|
||||
|
||||
trap _cleanup EXIT HUP INT TERM
|
||||
|
@ -24,6 +29,10 @@ curl -s "$API_ENDPOINT" |
|
|||
|
||||
env MARKDOWN=1 bash "$SCRIPT_DIR/missing_flathub_apps.sh" > "$missing_apps_list"
|
||||
|
||||
# Create a list of new Flatpak packages
|
||||
comm -13 <(sort "$unchecked_apps_list") <(sort "$missing_apps_list") |
|
||||
sed 's/\[ \][ ]//' > "$new_apps_list"
|
||||
|
||||
if ! diff -w --brief "$unchecked_apps_list" "$missing_apps_list" >/dev/null; then
|
||||
echo "Uptading issue #${API_ENDPOINT##*/} ..." >&2
|
||||
jq --compact-output --raw-input --slurp '. as $body | {$body}' \
|
||||
|
@ -32,8 +41,24 @@ if ! diff -w --brief "$unchecked_apps_list" "$missing_apps_list" >/dev/null; the
|
|||
--silent \
|
||||
--output /dev/null \
|
||||
--header "Authorization: token ${GITHUB_TOKEN?is not set}" \
|
||||
--header 'Accept: application/vnd.github+json' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'X-GitHub-Api-Version: 2022-11-28' \
|
||||
--data @- \
|
||||
--request PATCH "$API_ENDPOINT"
|
||||
fi
|
||||
|
||||
if [ -s "$new_apps_list" ]; then
|
||||
echo "Add a comment with new apps list ..." >&2
|
||||
jq --compact-output --raw-input --slurp '. as $body | {$body}' \
|
||||
"$new_apps_list" |
|
||||
curl \
|
||||
--silent \
|
||||
--output /dev/null \
|
||||
--header "Authorization: token ${GITHUB_TOKEN?is not set}" \
|
||||
--header 'Accept: application/vnd.github+json' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'X-GitHub-Api-Version: 2022-11-28' \
|
||||
--data @- \
|
||||
--request POST "$API_ENDPOINT/comments"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue