Skip to content

Commit fd3d0b9

Browse files
committed
Add rollback to GitHub Actions
See gh-
1 parent 4e1a8cb commit fd3d0b9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/rollback.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Rollback
2+
run-name: >-
3+
Rollback of version ${{ inputs.version }} (build number ${{ inputs.build-number}}) by ${{ github.actor }}
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
environment:
8+
description: Environment
9+
type: environment
10+
required: true
11+
version:
12+
description: The version number to roll back
13+
type: string
14+
required: true
15+
build-number:
16+
description: The build number to roll back
17+
type: string
18+
required: true
19+
jobs:
20+
rollback:
21+
environment: ${{ inputs.environment }}
22+
name: Roll Back
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check Out
26+
uses: actions/checkout@v4
27+
- name: Set Up JFrog CLI
28+
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
29+
env:
30+
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
31+
- name: Delete Staged Artifacts
32+
run: |
33+
url=${{ format('libs-staging-local/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }}
34+
artifact_count=$( jf rt s ${url} --count )
35+
if [ "${artifact_count}" != 1 ]; then
36+
echo "Unexpected aretifact count ${artifact_count}"
37+
exit 1
38+
fi
39+
build_name=${{ format('spring-javaformat-{0}', inputs.version)}}
40+
build_number=${{ inputs.build-number }}
41+
jf rt delete --dry-run --build ${build_name}/${build_number}

0 commit comments

Comments
 (0)