Skip to content

Prepare Revert PR

Prepare Revert PR #18

name: Prepare Revert PR
on:
workflow_dispatch:
inputs:
commitHash:
required: true
type: string
default: HEAD
description: |
The commit hash that you want to restore the library to, i.e. the last known working commit.
All subsequent commits will be reverted in the generated PR.
jobs:
prepare_revert_pr:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_AMPLIFY_WRITE }}
# mapping the inputs to these environment variables allows the @actions/core toolkit to pick up the inputs
INPUT_COMMITHASH: ${{ inputs.commitHash }}
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-api-next
token: ${{ secrets.GH_TOKEN_AMPLIFY_WRITE }}
# fetch full history so that we can properly lookup past releases
fetch-depth: 0
- name: Setup node and build the repository
uses: ./amplify-api-next/.github/actions/node-and-build
with:
is-prebuild: true
- name: Generate Revert PR
working-directory: ./amplify-api-next
run: npx tsx ./scripts/prepare-revert-pr.ts