https://github.com/gatoreducator/branchwrite
Write contents on a specific Git branch
https://github.com/gatoreducator/branchwrite
Last synced: about 1 month ago
JSON representation
Write contents on a specific Git branch
- Host: GitHub
- URL: https://github.com/gatoreducator/branchwrite
- Owner: GatorEducator
- License: mit
- Created: 2023-06-14T00:06:23.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T17:59:42.000Z (over 2 years ago)
- Last Synced: 2025-05-23T13:34:58.271Z (about 1 year ago)
- Language: Python
- Size: 91.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BranchWrite
Write a file on a specific Git branch under the GitHub workflow scenario.
## Premise and Setup
BranchWrite is designed to write contents in the running repository, such that authentication with writing permission is required to put into input arg `repo-token`. It's recommended to use `GITHUB_ACTION` token automatically generated by GitHub Action and enable write contents permission for it. FO more information about `GITHUB_ACTION`, please visit the [github doc](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)
## Usage
see [action.yml](action.yml)
### Example
#### content
```yaml
- name:
uses: GatorEducator/BranchWrite@v1
if:
always()
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
branch: insight
path: cool/insight.json
source: content
source-arg: hello from action
```
#### env
```yaml
- name:
uses: GatorEducator/BranchWrite@v1
if:
always()
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
branch: insight
path: cool/insight.json
source: env
source-arg: JSON_REPORT
```
#### branch + file
```yaml
- name:
uses: GatorEducator/BranchWrite@v1
if:
always()
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
branch: insight
path: cool/insight.json
source: branch-and-path
source-arg: main-branch/foo/bar.txt
```
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)