Skip to content

Commit eba2f65

Browse files
committed
Fix
1 parent 65f38b9 commit eba2f65

File tree

1 file changed

+56
-51
lines changed

1 file changed

+56
-51
lines changed

.github/workflows/pr-cleanup.yml

Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: cleanup PR
22

3-
on:
4-
pull_request_target:
5-
types: [closed]
3+
# on:
4+
# pull_request_target:
5+
# types: [closed]
6+
7+
on: [pull_request_target]
68

79
permissions: {}
810

@@ -17,58 +19,61 @@ jobs:
1719
permissions:
1820
actions: write
1921
steps:
20-
- name: Clean artifacts
21-
run: |
22-
set -u
22+
- run: echo "${{ toJSON(github)}}"
2323

24-
ARTIFACTS=$(
25-
gh api \
26-
--paginate \
27-
-H "Accept: application/vnd.github+json" \
28-
-H "X-GitHub-Api-Version: 2022-11-28" \
29-
/repos/probabl-ai/skore/actions/artifacts \
30-
|
31-
jq -c ".artifacts[] | select(.workflow_run.head_branch == \"${BRANCH}\") | {id: .id, name: .name}"
32-
)
24+
# - name: Clean artifacts
25+
# run: |
26+
# set -u
3327

34-
for ARTIFACT in $ARTIFACTS; do
35-
ID=$(echo "${ARTIFACT}" | jq -r '.id')
36-
NAME=$(echo "${ARTIFACT}" | jq -r '.name')
28+
# ARTIFACTS=$(
29+
# gh api \
30+
# --paginate \
31+
# -H "Accept: application/vnd.github+json" \
32+
# -H "X-GitHub-Api-Version: 2022-11-28" \
33+
# /repos/probabl-ai/skore/actions/artifacts \
34+
# |
35+
# jq -c ".artifacts[] | select(.workflow_run.head_branch == \"${HEAD_BRANCH}\") | {id: .id, name: .name}"
36+
# )
3737

38-
echo "Deleting artifact (BRANCH: \"${BRANCH}\", NAME: \"${NAME}\", ID: \"${ID}\")"
38+
# for ARTIFACT in $ARTIFACTS; do
39+
# ID=$(echo "${ARTIFACT}" | jq -r '.id')
40+
# NAME=$(echo "${ARTIFACT}" | jq -r '.name')
3941

40-
gh api \
41-
--method DELETE \
42-
--silent \
43-
-H "Accept: application/vnd.github+json" \
44-
-H "X-GitHub-Api-Version: 2022-11-28" \
45-
/repos/${REPOSITORY_OWNER}/${REPOSITORY_NAME}/actions/artifacts/${ID}
46-
done
47-
env:
48-
GH_TOKEN: ${{ github.token }}
49-
REPOSITORY_OWNER: ${{ github.repository_owner }}
50-
REPOSITORY_NAME: ${{ github.event.repository.name }}
51-
BRANCH: ${{ github.head_ref }}
42+
# echo "Deleting artifact (HEAD BRANCH: \"${HEAD_BRANCH}\", NAME: \"${NAME}\", ID: \"${ID}\")"
5243

53-
clean-documentation-preview:
54-
if: always()
55-
runs-on: ubuntu-latest
56-
steps:
57-
- name: Install `rclone`
58-
shell: bash
59-
run: |
60-
sudo apt-get update
61-
sudo apt-get install -y rclone
44+
# gh api \
45+
# --method DELETE \
46+
# --silent \
47+
# -H "Accept: application/vnd.github+json" \
48+
# -H "X-GitHub-Api-Version: 2022-11-28" \
49+
# /repos/${REPOSITORY_OWNER}/${REPOSITORY_NAME}/actions/artifacts/${ID}
50+
# done
51+
# env:
52+
# GH_TOKEN: ${{ github.token }}
53+
# REPOSITORY_OWNER: ${{ github.repository_owner }}
54+
# REPOSITORY_NAME: ${{ github.event.repository.name }}
55+
# HEAD_REPOSITORY_ID: ${{ }}
56+
# HEAD_BRANCH: ${{ github.head_ref }}
57+
58+
# clean-documentation-preview:
59+
# if: always()
60+
# runs-on: ubuntu-latest
61+
# steps:
62+
# - name: Install `rclone`
63+
# shell: bash
64+
# run: |
65+
# sudo apt-get update
66+
# sudo apt-get install -y rclone
6267

63-
- name: Copy configuration
64-
shell: bash
65-
run: echo "${CONFIGURATION}" > rclone.configuration
66-
env:
67-
CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOC_PREVIEW }}
68+
# - name: Copy configuration
69+
# shell: bash
70+
# run: echo "${CONFIGURATION}" > rclone.configuration
71+
# env:
72+
# CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOC_PREVIEW }}
6873

69-
- name: Clean documentation preview
70-
run: rclone --config rclone.configuration purge "${PROVIDER}:${BUCKET}/${PULL_REQUEST_NUMBER}" -vvvv
71-
env:
72-
PROVIDER: scaleway
73-
BUCKET: ${{ vars.DOCUMENTATION_PREVIEW_BUCKET }}
74-
PULL_REQUEST_NUMBER: ${{ github.event.number }}
74+
# - name: Clean documentation preview
75+
# run: rclone --config rclone.configuration purge "${PROVIDER}:${BUCKET}/${PULL_REQUEST_NUMBER}" -vvvv
76+
# env:
77+
# PROVIDER: scaleway
78+
# BUCKET: ${{ vars.DOCUMENTATION_PREVIEW_BUCKET }}
79+
# PULL_REQUEST_NUMBER: ${{ github.event.number }}

0 commit comments

Comments
 (0)