Merge branch 'master' into patch-4
This commit is contained in:
26
README.md
26
README.md
@@ -39,6 +39,32 @@ jobs:
|
|||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
An example workflow to authenticate with GitHub Platform via Deploy Keys or in general SSH:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
persist-credentials: true
|
||||||
|
- name: Create local changes
|
||||||
|
run: |
|
||||||
|
...
|
||||||
|
- name: Commit files
|
||||||
|
run: |
|
||||||
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git commit -m "Add changes" -a
|
||||||
|
- name: Push changes
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
ssh: true
|
||||||
|
branch: ${{ github.ref }}
|
||||||
|
```
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
| name | value | default | description |
|
| name | value | default | description |
|
||||||
|
@@ -13,6 +13,9 @@ inputs:
|
|||||||
description: 'GitHub url or GitHub Enterprise url'
|
description: 'GitHub url or GitHub Enterprise url'
|
||||||
required: true
|
required: true
|
||||||
default: ${{ github.server_url }}
|
default: ${{ github.server_url }}
|
||||||
|
ssh:
|
||||||
|
description: 'Specify if ssh should be used'
|
||||||
|
required: false
|
||||||
repository:
|
repository:
|
||||||
description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
|
description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
|
||||||
default: ''
|
default: ''
|
||||||
|
5
start.sh
5
start.sh
@@ -2,6 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
INPUT_FORCE=${INPUT_FORCE:-false}
|
INPUT_FORCE=${INPUT_FORCE:-false}
|
||||||
|
INPUT_SSH=${INPUT_SSH:-false}
|
||||||
INPUT_TAGS=${INPUT_TAGS:-false}
|
INPUT_TAGS=${INPUT_TAGS:-false}
|
||||||
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
||||||
_FORCE_OPTION=''
|
_FORCE_OPTION=''
|
||||||
@@ -23,6 +24,10 @@ fi
|
|||||||
|
|
||||||
cd ${INPUT_DIRECTORY}
|
cd ${INPUT_DIRECTORY}
|
||||||
|
|
||||||
|
if ${INPUT_SSH}; then
|
||||||
|
remote_repo="git@${INPUT_GITHUB_URL}:${REPOSITORY}.git"
|
||||||
|
else
|
||||||
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
|
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
|
||||||
|
fi
|
||||||
|
|
||||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
|
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
|
||||||
|
Reference in New Issue
Block a user