Created
April 18, 2021 06:31
-
-
Save anshumanb/16bf5e89354485f37912888d04d1be42 to your computer and use it in GitHub Desktop.
Commit the result of a Github Actions job to its repository
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
# Adapted from | |
# https://github.com/actions/checkout/blob/25a956c84d5dd820d28caab9f86b8d183aeeff3d/README.md#push-a-commit-using-the-built-in-token | |
# https://stackoverflow.com/a/8123841/822292 | |
name: Commit the result of this Github Actions job to this repository | |
on: push | |
jobs: | |
my-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
... | |
- name: Commit new and updated files back to this repository | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git diff-index --quiet HEAD || git commit -m "[skip ci] Save result of action" | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment