Skip to content

Adding the update-snapshot workflow #2

Adding the update-snapshot workflow

Adding the update-snapshot workflow #2

name: Update Snapshots on a PR
on:
pull_request:
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:
- 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 }}