Created
May 2, 2020 18:28
-
-
Save vanpariyar/60311b36708f4a613dc9b85a42ec9d98 to your computer and use it in GitHub Desktop.
Commit back to the repository from a workflow
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: 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 "[email protected]" | |
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