Skip to content

Update Snapshots on a PR #6

Update Snapshots on a PR

Update Snapshots on a PR #6

name: Update Snapshots on a PR
on:
workflow_dispatch:
inputs:
pr_number:
description: "Pull Request Number"
required: true
type: string
permissions:
pull-requests: write
contents: write
jobs:
update-pr:
name: Update PR Snapshots
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Checkout PR
if: github.event_name == 'workflow_dispatch'
run: gh pr checkout ${{ github.event.inputs.pr_number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run command
if: github.event_name == 'workflow_dispatch'
run: |
echo "Running A command here command..."
# Step 5: Commit and push changes back to the PR branch
# - name: Commit and push changes
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# git add .
# git commit -m "Automated updates from GitHub Actions"
# git push origin ${{ env.PR_BRANCH }}