Delete preview from OVH Object Storage #1950
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete preview from OVH Object Storage | |
on: | |
workflow_run: | |
workflows: ["Ask preview removal for a given PR"] | |
types: | |
- completed | |
jobs: | |
upload: | |
name: Upload preview to OVH Object Storage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: PR | |
github-token: ${{ github.token }} | |
run-id: ${{ github.event.workflow_run.id }} | |
- name: Get PR number | |
id: pr_number | |
run: echo "pr_number=$(cat PR_NUMBER)" >> $GITHUB_OUTPUT | |
- name: Install Swift | |
run: | | |
pip install python-swiftclient==4.3.0 python-keystoneclient==5.1.0 | |
- name: OVH Object Storage | |
run: | | |
swift delete sekoiaio-documentation-previews -p ${{ steps.pr_number.outputs.pr_number }} --object-threads 5 | |
env: | |
OS_AUTH_URL: "https://auth.cloud.ovh.net/v3/" | |
OS_IDENTITY_API_VERSION: 3 | |
OS_TENANT_ID: ${{ secrets.PR_OS_TENANT_ID }} | |
OS_TENANT_NAME: ${{ secrets.PR_OS_TENANT_NAME }} | |
OS_USERNAME: ${{ secrets.PR_OS_USERNAME }} | |
OS_PASSWORD: ${{ secrets.PR_OS_PASSWORD }} | |
OS_REGION_NAME: "GRA" | |
- name: Find Comment | |
uses: peter-evans/find-comment@v3 | |
id: fc | |
with: | |
issue-number: ${{ steps.pr_number.outputs.pr_number }} | |
comment-author: github-actions[bot] | |
body-includes: Newest code from ${{ github.actor}} has been published to | |
- name: Add comment to PR | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.pr_number.outputs.pr_number }} | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
edit-mode: replace | |
body: | | |
_Pull request was merged, preview was removed._ |