-
Notifications
You must be signed in to change notification settings - Fork 57.2k
Expand file tree
/
Copy pathutil-cleanup-abandoned-release-branches.yml
More file actions
40 lines (34 loc) · 1.23 KB
/
util-cleanup-abandoned-release-branches.yml
File metadata and controls
40 lines (34 loc) · 1.23 KB
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
36
37
38
39
40
name: 'Util: Cleanup abandoned release branches'
on:
pull_request:
types: [closed]
jobs:
delete-release-branch:
# Only if PR was closed without merge
if: >
github.event.pull_request.merged == false
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.N8N_ASSISTANT_APP_ID }}
private-key: ${{ secrets.N8N_ASSISTANT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Setup Node.js
uses: ./.github/actions/setup-nodejs
with:
build-command: ''
install-command: pnpm install --frozen-lockfile --dir ./.github/scripts --ignore-workspace
- name: Cleanup release branch if PR qualifies
run: node .github/scripts/cleanup-release-branch.mjs
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
GITHUB_REPOSITORY: ${{ github.repository }}