Created
November 21, 2019 18:33
-
-
Save christeredvartsen/d9a3efd2e2121ef710d30cbbce6bbff3 to your computer and use it in GitHub Desktop.
Commit back to the repository from a workflow
This file contains 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