Commit ba9a0bbe authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Merge branch 'close-messages' into 'master'

Use custom close messages for archlinux/svntogit-{community,packages}

Closes #1

See merge request !2
parents a1551eb5 262cebd1
Pipeline #21935 passed with stage
in 7 seconds
{
"archlinux/svntogit-packages": "This project is a read-only mirror.",
"archlinux/svntogit-community": "This project is a read-only mirror.",
"default": "This project is a read-only mirror of: ${upstream_url}, please submit your work there."
}
#!/bin/bash
set -o nounset -o errexit -o pipefail
close_message='This project is a read-only mirror of: ${upstream_url}, please submit your work there.
*This comment was generated by [${CI_PROJECT_NAME}](${CI_PROJECT_URL}).*'
function curl() {
command curl --silent \
......@@ -41,6 +38,8 @@ if [[ $action = opened ]] || [[ $action = reopened ]]; then
repository_full_name="$(jq -er .repository.full_name < "${TRIGGER_PAYLOAD}")"
upstream_url="${CI_SERVER_URL}/${repository_full_name}"
close_message="$(jq -r --arg repository_full_name "${repository_full_name}" '.[$repository_full_name] // .["default"]' close-messages.json)"
close_message+=$'\n\n*This comment was generated by [${CI_PROJECT_NAME}](${CI_PROJECT_URL}).*'
body="$(eval "echo \"${close_message}\"")"
# https://docs.github.com/en/rest/reference/issues#create-an-issue-comment
curl --request POST \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment