Skip to content

Commit df39337

Browse files
authored
*fix: Remove the user (#169)
*doc: Adjust the documentation *fix: Add empty line at the end of the file
1 parent c361e2b commit df39337

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Diff for: README.md

+25
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,31 @@ jobs:
8686
force_with_lease: true
8787
```
8888
89+
An example workflow to use the non default token push to another repository. Be aware that the force-with-lease flag is in such a case not possible:
90+
91+
```yaml
92+
jobs:
93+
build:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v3
97+
with:
98+
ref: ${{ github.head_ref }}
99+
fetch-depth: 0
100+
token: ${{ secrets.PAT_TOKEN }}
101+
- name: Commit files
102+
run: |
103+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
104+
git config --local user.name "github-actions[bot]"
105+
git commit -a -m "Add changes"
106+
- name: Push changes
107+
uses: ad-m/github-push-action@master
108+
with:
109+
github_token: ${{ secrets.PAT_TOKEN }}
110+
repository: Test/test
111+
force: true
112+
```
113+
89114
An example workflow to update/ overwrite an existing tag:
90115
91116
```yaml

Diff for: start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cd ${INPUT_DIRECTORY}
4343
if ${INPUT_SSH}; then
4444
remote_repo="git@${INPUT_GITHUB_URL}:${REPOSITORY}.git"
4545
else
46-
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
46+
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//oauth2:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
4747
fi
4848

4949
git config --local --add safe.directory ${INPUT_DIRECTORY}

0 commit comments

Comments
 (0)