Skip to content

Commit c224bc4

Browse files
authored
ci: use environment variables to process pull request conclusions (#53)
1 parent 8073429 commit c224bc4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/delete-pr-build-on-close.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ jobs:
2525
- name: Delete pre-release and tag named after branch
2626
env:
2727
GH_TOKEN: ${{ github.token }}
28+
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
29+
PR_NUMBER: ${{ github.event.pull_request.number }}
30+
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
2831
shell: bash
2932
run: |
3033
# Use either an upstream or fork PR branch
31-
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
32-
BRANCH="pull/${{ github.event.pull_request.number }}/head"
34+
if [[ "$PR_REPO" != "slackapi/slack-cli" ]]; then
35+
BRANCH="pull/$PR_NUMBER/head"
3336
else
34-
BRANCH="${{ github.event.pull_request.head.ref }}"
37+
BRANCH="$PR_BRANCH"
3538
fi
3639
3740
# Escape tags to create a semantic version

0 commit comments

Comments
 (0)