This reverts commit d4a6a7883a40e2ff04f1943ca6871fc03fc5a738.
This commit is contained in:
parent
d4a6a7883a
commit
21d44fe927
26
README.md
26
README.md
@ -39,37 +39,11 @@ 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 }}
|
|
||||||
- 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:
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
ssh: true
|
|
||||||
```
|
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
| name | value | default | description |
|
| name | value | default | description |
|
||||||
| ---- | ----- | ------- | ----------- |
|
| ---- | ----- | ------- | ----------- |
|
||||||
| github_token | string | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). |
|
| github_token | string | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). |
|
||||||
| ssh | boolean | false | Determines if ssh is used. |
|
|
||||||
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
|
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
|
||||||
| force | boolean | false | Determines if force push is used. |
|
| force | boolean | false | Determines if force push is used. |
|
||||||
| tags | boolean | false | Determines if `--tags` is used. |
|
| tags | boolean | false | Determines if `--tags` is used. |
|
||||||
|
@ -13,9 +13,6 @@ 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: ''
|
||||||
|
6
start.sh
6
start.sh
@ -23,13 +23,7 @@ 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 config --local --add safe.directory ${INPUT_DIRECTORY}
|
git config --local --add safe.directory ${INPUT_DIRECTORY}
|
||||||
|
|
||||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
|
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user