-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6412170
commit b17e682
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Delete manually created release | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
validate-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Delete Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "Deleting release: ${{ github.event.release.tag_name }}" | ||
gh release delete ${{ github.event.release.tag_name }} --yes | ||
- name: Delete the release and tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "Deleting tag: ${{ github.event.release.tag_name }}" | ||
git tag -d ${{ github.event.release.tag_name }} | ||
git push origin --delete ${{ github.event.release.tag_name }} | ||
- name: Why was this release deleted? | ||
run: | | ||
cat <<EOF | ||
Our release process commits assets to the 'releases' branch - and that has to occur before the | ||
git tag is created. Because of that fact, we need to prevent anyone from creating a release in the GitHub UI. | ||
Instead, use the release workflow. | ||
EOF |