Skip to content

Commit

Permalink
Add rollback to GitHub Actions
Browse files Browse the repository at this point in the history
See gh-
  • Loading branch information
philwebb committed Jun 8, 2024
1 parent 4e1a8cb commit c703ad0
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Rollback
run-name: >-
Rollback of version ${{ inputs.version }} (build number ${{ inputs.build-number}}) by ${{ github.actor }}
on:
workflow_dispatch:
inputs:
environment:
description: Environment
type: environment
required: true
version:
description: The version number to roll back
type: string
required: true
build-number:
description: The build number to roll back
type: string
required: true
jobs:
rollback:
environment: ${{ inputs.environment }}
name: Roll Back
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v4
- name: Set Up JFrog CLI
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Delete Staged Artifacts
run: |
url=${{ format('libs-staging-local/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }}
artifact_count=$( jf rt s ${url} --count )
if [ "${artifact_count}" != 1 ]; then
echo "Unexpected aretifact count ${artifact_count}"
exit 1
fi
build-name=${{ format('spring-javaformat-{0}', inputs.version)}}
build-number=${{ inputs.build-number }}
jf rt delete --dry-run --build ${build-name}/${build-number}

0 comments on commit c703ad0

Please sign in to comment.