Skip to content

Commit

Permalink
GitHub: Remove delete_draft_release. (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko authored Jul 25, 2024
1 parent 340ebb1 commit 7632a5d
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,6 @@ on:
types: [closed]

jobs:
delete_draft_release:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Delete draft releases and tags
env:
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
run: |
for provider_dir in capa/v* azure/v*; do
provider=""
if [[ $provider_dir == capa/* ]]; then
provider="aws"
elif [[ $provider_dir == azure/* ]]; then
provider="azure"
fi
if [[ ! -f $provider_dir/release.yaml || -z $provider ]]; then
echo "Skipping file or unknown provider $provider_dir"
continue
fi
release_version="$(basename $provider_dir)"
draft_tag_name="draft/$provider/$release_version"
draft_release=$(gh release --repo giantswarm/releases view "$draft_tag_name" --json "id,name,tagName,assets,isDraft,isPrerelease,url" 2>&1 || true)
if [ "$draft_release" = "release not found" ]; then
echo "Draft release not found for tag $draft_tag_name"
else
echo "Found existing draft release $draft_tag_name, will delete it."
gh release delete --repo giantswarm/releases "$draft_tag_name" --yes --cleanup-tag
fi
done
create_release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7632a5d

Please sign in to comment.