-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add flag to remove the file. #98
Comments
Hello, is there an ETA or plan to resolve this issue? I believe is important as it leaves sanitizing the Confluence space as a manual labor in case you want to move pages around. |
We came up with this workaround: tag the pages manually that need to be deleted, then run this script. This calls the API to list the tagged pages (also filter for pages created by the bot account), and then calls the API again to delete the pages: #!/bin/bash
set -euo pipefail
pages=$(curl -u "$CONFLUENCE_USERNAME:$CONFLUENCE_PASSWORD" -X GET "${CONFLUENCE_URL}rest/api/search?cql=contributor='${CONFLUENCE_USERNAME}'+and+label='delete_pls'")
echo "${pages}"
for row in $(echo "${pages}" | tr '\r\n' ' ' | jq -r '.results[] | @base64'); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
echo "Deleting page: $(_jq '.title') from $(_jq '.url')"
curl -S --fail -u "$CONFLUENCE_USERNAME:$CONFLUENCE_PASSWORD" -X DELETE "${CONFLUENCE_URL}rest/api/content/$(_jq '.content.id')"
done
|
I'm not providing any ETA for any features, if it's an important feature and you'd like to see it as part of mark, you can create a pull request with a feature implementation. I'll be glad to merge it and release a new version with it. |
I'd like an option to remove a file. If I have this in CI/CD, I'll end up with all of the deleted files just stagnating. Would you be able to add an option like
-d
/--delete
which reads the header and removes the article at that place?I'd like to do something like this:
and then loop over those deleted files and remove them from confluence:
(Obviously accounting for spaces and such, it will look more complicated)
The text was updated successfully, but these errors were encountered: