File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 86
86
force_with_lease : true
87
87
` ` `
88
88
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
+
89
114
An example workflow to update/ overwrite an existing tag:
90
115
91
116
` ` ` yaml
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ cd ${INPUT_DIRECTORY}
43
43
if ${INPUT_SSH} ; then
44
44
remote_repo=" git@${INPUT_GITHUB_URL} :${REPOSITORY} .git"
45
45
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"
47
47
fi
48
48
49
49
git config --local --add safe.directory ${INPUT_DIRECTORY}
You can’t perform that action at this time.
0 commit comments