name: Update master branch

on:
  push:
    branches:
      - main

jobs:
  update-ref:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v3
        with:
          script: |
            github.git.updateRef({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: 'heads/master',
              sha: context.sha,
            })

name: Update master branch

on:
  push:
    branches:
      - main

jobs:
  update-ref:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          git update-ref refs/heads/master "${GITHUB_SHA}"
          git push origin master

Use Git commit instead of GitHub script
Use Git commit instead of GitHub script
