Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Update files on GitHub

Actions
Update (i.e. commit and push) files on GitHub
v1.1.0
Star (40)

action-update-file Version Lint status

Update (i.e. commit and push) files on GitHub.

Usage

The action requires GitHub token for authentication; no username or e-mail are required.

Here is an example of a workflow using action-update-file:

name: Resources
on: repository_dispatch
jobs:
  resources:
    name: Update resources
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@v1
    - name: Fetch resources
      run: ./scripts/fetch-resources.sh
    - name: Update resources
      uses: test-room-7/action-update-file@v1
      with:
        file-path: path/to/file
        commit-msg: Update resources
        github-token: ${{ secrets.GITHUB_TOKEN }}

Note that this action does not change files. They should be changed with scripts and/or other actions.

You can also update multiple files:

name: Resources
on: repository_dispatch
jobs:
  resources:
    name: Update resources
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@v1
    - name: Fetch resources
      run: ./scripts/fetch-resources.sh
    - name: Update resources
      uses: test-room-7/action-update-file@v1
      with:
        file-path: |
            path/to/file1
            path/to/file2
            path/to/file3
        commit-msg: Update resources
        github-token: ${{ secrets.GITHUB_TOKEN }}

Inputs

Required inputs

  • commit-msg: a text used as a commit message
  • file-path: a path to file to be updated
  • github-token: GitHub token

Optional inputs

  • branch: branch to push changes (master by default)
  • allow-removing: allow to remove file if local copy is missing (false by default)

Note that the action will produce an error if a local copy of a given file is missing, and the allow-removing flag is false.

Outputs

  • commit-sha: the hash of the commit created by this action

License

See the license file.

Update files on GitHub is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Update (i.e. commit and push) files on GitHub
v1.1.0

Update files on GitHub is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.