Skip to content

Commit

Permalink
only checkout repo in case the target branch does not exist..
Browse files Browse the repository at this point in the history
  • Loading branch information
sydseter committed Apr 17, 2024
1 parent fcb7f67 commit 4f5f6a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/delete-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ jobs:
needs: hardening
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ github.event.pull_request.head.ref }}-artifacts
- name: Delete artifact target branch
id: delete-artifact-target-branch
env:
TARGET_BRANCH: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin :"tmp-$TARGET_BRANCH-artifacts" || echo "Could not delete $TARGET_BRANCH-artifacts"
git push origin :"tmp-$TARGET_BRANCH-artifacts" || echo "Could not delete tmp-$TARGET_BRANCH-artifacts"

0 comments on commit 4f5f6a4

Please sign in to comment.