|
1 |
| -# push |
| 1 | +# GitHub Action for GitHub Commit & Push |
2 | 2 |
|
3 |
| -Push changes made by actions right back into the current repository. |
| 3 | +The GitHub Actions for commiting & pushing to GitHub repository local changes authorizing using GitHub token. |
4 | 4 |
|
5 |
| -```yml |
6 |
| -uses: actions-js/push@v1 |
7 |
| -env: |
8 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
9 |
| -``` |
| 5 | +With ease: |
| 6 | +- update new code placed in the repository, e.g. by running a linter on it, |
| 7 | +- track changes in script results using Git as archive, |
| 8 | +- publish page using GitHub-Pages, |
| 9 | +- mirror changes to a separate repository. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +### Example Workflow file |
| 14 | + |
| 15 | +An example workflow to authenticate with GitHub Platform: |
| 16 | + |
| 17 | +```yaml |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@master |
| 23 | + with: |
| 24 | + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token |
| 25 | + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo |
| 26 | + - name: Create local changes |
| 27 | + run: | |
| 28 | + ... |
| 29 | + - name: Commit & Push changes |
| 30 | + uses: actions-js/push@master |
| 31 | + with: |
| 32 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 33 | +``` |
| 34 | +
|
| 35 | +### Inputs |
| 36 | +
|
| 37 | +| name | value | default | description | |
| 38 | +| ------------ | ------ | ----------------- | ----------- | |
| 39 | +| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. | |
| 40 | +| user_email | string | action@github.com | Email used to configure user.email in `git config`. | |
| 41 | +| user_name | string | GitHub Action | Name used to configure user.name in `git config`. | |
| 42 | +| branch | string | 'master' | Destination branch to push changes. | |
| 43 | +| force | boolean | false | Determines if force push is used. | |
| 44 | +| tags | boolean | false | Determines if `--tags` is used. | |
| 45 | +| directory | string | '.' | Directory to change to before pushing. | |
| 46 | +| repository | string | '' | Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a [personal access token](https://github.com/settings/tokens) and use it as the `github_token` input. | |
| 47 | + |
| 48 | +## License |
| 49 | + |
| 50 | +The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE). |
| 51 | + |
| 52 | +## Credits |
| 53 | + |
| 54 | +This is a slight modification of the [ad-m/github-push-action](https://github.com/ad-m/github-push-action) action. |
| 55 | + |
| 56 | +## No affiliation with GitHub Inc. |
| 57 | + |
| 58 | +GitHub are registered trademarks of GitHub, Inc. GitHub name used in this project are for identification purposes only. The project is not associated in any way with GitHub Inc. and is not an official solution of GitHub Inc. It was made available in order to facilitate the use of the site GitHub. |
0 commit comments