Skip to content

GitHub repository commit #3

GitHub repository commit

GitHub repository commit #3

# https://github.com/skills/hello-github-actions
name: GitHub repository commit
on:
workflow_dispatch:
permissions:
contents: write
jobs:
commit-on-branch:
name: Commit a new file
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare a branch, and file
run: |
date >> README.md
BRANCH=content
git checkout -b $BRANCH
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Add date to README.md"
git push --set-upstream origin $BRANCH
git checkout main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}