Saptarshi's Notes 📝
  • HOME
  • Open-Source
    • Issue Template
    • Pull Request Template
    • Greetings Action
    • Stale Action
    • Push to Pull Requests Action
    • Contributing Guide
    • Security
  • Computer Networking
    • Introduction
    • IP Address
    • Data Transmission
      • Network Topologies
      • Structure of The Network
      • Network Devices
    • How does The Internet work?
      • OSI Model
      • TCP/IP Model
        • Application Layer
          • Application Layer Network Protocols
          • Sockets
          • Ports
        • Transport Layer
        • Network Layer
        • Data Link Layer
        • Physical Layer
Powered by GitBook
On this page

Was this helpful?

  1. Open-Source

Push to Pull Requests Action

A GitHub Actions workflow to push changes to pull request

name: Push changes to Pull Request's Source Branch

on:
    push:
    pull_request:

jobs:
    create-and-push:
        name: Create file and push
        runs-on: ubuntu-latest
        permissions: write-all
        steps:
            - name: Checkout repository
              uses: actions/checkout@v4
              with:
                ref: ${{ github.event.pull_request.head.sha }}
            - name: Create a test txt file
              run: touch test.txt
            - name: Commit changes
              run: |
                git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
                git config --global user.name "github-actions[bot]"
                git add .
                if [[ $(git status --porcelain) ]]; then
                   git commit -m "style: Formatted Java files"
                fi
            - name: Push changes
              if: github.event_name != 'pull_request'
              run: git push
PreviousStale ActionNextContributing Guide

Last updated 3 days ago

Was this helpful?