Skip to content

Instantly share code, notes, and snippets.

@vanpariyar
Forked from christeredvartsen/master.yml
Created May 2, 2020 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanpariyar/60311b36708f4a613dc9b85a42ec9d98 to your computer and use it in GitHub Desktop.
Save vanpariyar/60311b36708f4a613dc9b85a42ec9d98 to your computer and use it in GitHub Desktop.
Commit back to the repository from a workflow
name: Commit from workflow
on:
push:
branches:
- master
paths-ignore:
- file.txt
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Commit some stuff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "user@example.com"
git config user.name "User Name"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git checkout master
echo "foo" >> file.txt
git add file.txt
git commit -m "Some commit message"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment