Skip to content

Commit

Permalink
Update documentation with fixes for common problems (#57)
Browse files Browse the repository at this point in the history
* Update README.md

* sp
  • Loading branch information
jukent authored Aug 22, 2023
1 parent 208a500 commit 3a8ed85
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,36 @@ jobs:
exclude: "**/*.py" # Do not modify Python files
```

If you are getting an error message that reads, "refusing to allow a GitHub App to create or update workflow ..." it means that your GitHub action may be trying to edit your new workflow file. Omit this file from the find-and-replace search with `exclude: .`.

```yaml
name: My Workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "hello"
replace: "world"
exclude: . # Do not modify this file
```

### Pushing changes back

Any modifications during a GitHub Actions workflow are only made to the working copy checked out by the `actions/checkout` step. If you want those changes to be pushed back to the repository you'll need to add a final step that does this.
Any modifications during a GitHub Actions workflow are only made to the working copy checked out by the `actions/checkout` step. If you want those changes to be pushed back to the repository you'll need to add a final step that does this. You will have to give your workflow write permissions.

```yaml
name: My Workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Find and Replace
Expand All @@ -126,10 +146,7 @@ jobs:
replace: "world"
regex: false
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
uses: stefanzweifel/git-auto-commit-action@v4
```

_If you need the push event to trigger other workflows, use a `repo` scoped [Personal Access Token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)._
Expand Down

0 comments on commit 3a8ed85

Please sign in to comment.