-
Notifications
You must be signed in to change notification settings - Fork 444
35 lines (32 loc) · 1.14 KB
/
pr-cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: PR Cleanup
on:
pull_request:
types: [closed]
jobs:
release_preview_canister:
# do not run in forks
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
concurrency:
group: pr-${{ github.event.pull_request.number || github.event.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: |
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
pip install ic-py
python3 .github/workflows/scripts/release-canister.py $pull_number
env:
DFX_IDENTITY_PREVIEW: ${{ secrets.DFX_IDENTITY_PREVIEW }}
POOL_CANISTER_ID: ${{ secrets.POOL_CANISTER_ID }}
- uses: actions/github-script@v6
with:
script: |
const comments = require('./.github/workflows/scripts/comments.js');
const maybeComment = await comments.get(context, github);
if (maybeComment) {
await comments.delete(context, github, maybeComment.id);
}