Hard Reset Branch #69
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
name: Hard Reset Branch | |
on: | |
workflow_dispatch: | |
inputs: | |
branch_to_reset: | |
description: 'Branch to hard reset' | |
required: true | |
default: 'master' | |
jobs: | |
hard_reset_branch: | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.JENKINSGENESIS_TOKEN }} | |
ref: ${{ github.event.inputs.branch_to_reset }} | |
fetch-depth: 0 # Fetch all history for git reset | |
- name: Fetch all branches | |
run: git fetch --all | |
- name: Hard reset the branch to preprod | |
run: git reset --hard origin/preprod | |
- name: Push hard reset branch | |
run: git push origin ${{ github.event.inputs.branch_to_reset }} --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |