chore: update permissions and simplify token usage in sync-branches w… #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Main to Staging | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout staging branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: staging | |
| # The GITHUB_TOKEN is automatically used here due to the `permissions` key | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Merge main into staging | |
| run: | | |
| git pull origin main | |
| git push origin staging |