From 197ab3e4dedb754d456eb74c79a910a4db221c7e Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Sun, 27 Oct 2019 09:52:15 +0100 Subject: [PATCH] Add "GitHub Action for GitHub Push" --- src/actions/github-push-action.md | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/actions/github-push-action.md diff --git a/src/actions/github-push-action.md b/src/actions/github-push-action.md new file mode 100644 index 0000000..2942925 --- /dev/null +++ b/src/actions/github-push-action.md @@ -0,0 +1,56 @@ +--- +path: '/github-push-action' +title: 'github-push-action' +github_url: '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/ad-m/github-push-action' +author: 'ad-m' +tags: ['git'] +subtitle: 'The GitHub Actions for pushing to GitHub repository local changes authorizing using GitHub token.' +--- + +# GitHub Action for GitHub Push + +The GitHub Actions for pushing to GitHub repository local changes authorizing using GitHub token. + +With ease: +- update new code placed in the repository, e.g. by running a linter on it, +- track changes in script results using Git as archive, +- publish page using GitHub-Pages, +- mirror changes to a separate repository. + +## Example Workflow file + +An example workflow to authenticate with GitHub Platform: + +```yaml +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Create local changes + run: | + ... + - name: Commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "Add changes" -a + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} +``` + +## Inputs + +| name | value | default | description | +| ---- | ----- | ------- | ----------- | +| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. | +| branch | string | 'master' | Destination branch to push changes. | +| force | boolean | false | Determines if force push is used. | +| directory | string | '.' | Directory to change to before pushing. | +| 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. | + +## No affiliation with GitHub Inc. + +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.