-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.79 KB
/
Shared-Rollback-If-Failure.yml
File metadata and controls
53 lines (46 loc) · 1.79 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
41
42
43
44
45
46
47
48
49
50
51
52
53
# *************************************************************************
# ** Copyright (c) 2022-25 CentraleSupélec & EDF.
# ** All rights reserved. This program and the accompanying materials
# ** are made available under the terms of the Eclipse Public License v2.0
# ** which accompanies this distribution, and is available at
# ** https://www.eclipse.org/legal/epl-v20.html
# **
# ** This file is part of the RiseClipse tool
# **
# ** Contributors:
# ** Computer Science Department, CentraleSupélec
# ** EDF R&D
# ** Contacts:
# ** dominique.marcadet@centralesupelec.fr
# ** aurelie.dehouck-neveu@edf.fr
# ** Web site:
# ** https://riseclipse.github.io
# *************************************************************************
name: Rollback if failure
# This CD workflow rollbacks the Pre-Release and Prepare next development version
# When a PR is closed or in if the prepare-next-dev workflow fails
# Proceeds to delete do_release branch, delete the pre-release and delete the tag
on: workflow_call
jobs:
rollback-if-failure:
# Use a specific version to avoid unattended changes with latest
runs-on: ubuntu-24.04
name: Rollback if failure
steps:
- name: Delete branch do_release
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{github.token}}
branches: do_release
- name: Get latest pre-release
uses: rez0n/actions-github-release@main
id: release-tag
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: riseclipse/${{ github.event.repository.name }}
type: "prerelease"
- name: Delete pre-release and tag
run: |
gh release delete --yes --cleanup-tag ${{ steps.release-tag.outputs.release }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}