This reverts commit d4a6a7883a40e2ff04f1943ca6871fc03fc5a738.
This commit is contained in:
parent
d4a6a7883a
commit
21d44fe927
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@ -7,14 +7,14 @@ on:
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Verify action syntax
|
||||
# The action should not publish any real changes, but should succeed.
|
||||
uses: './'
|
||||
with:
|
||||
github_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
branch: '${{ github.ref }}'
|
||||
- uses: actions/checkout@master
|
||||
- name: Verify action syntax
|
||||
# The action should not publish any real changes, but should succeed.
|
||||
uses: './'
|
||||
with:
|
||||
github_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
branch: '${{ github.ref }}'
|
||||
|
26
README.md
26
README.md
@ -39,37 +39,11 @@ jobs:
|
||||
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
|
||||
|
||||
| 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). |
|
||||
| ssh | boolean | false | Determines if ssh is used. |
|
||||
| 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. |
|
||||
| tags | boolean | false | Determines if `--tags` is used. |
|
||||
|
@ -13,9 +13,6 @@ inputs:
|
||||
description: 'GitHub url or GitHub Enterprise url'
|
||||
required: true
|
||||
default: ${{ github.server_url }}
|
||||
ssh:
|
||||
description: 'Specify if ssh should be used'
|
||||
required: false
|
||||
repository:
|
||||
description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
|
||||
default: ''
|
||||
|
8
start.sh
8
start.sh
@ -23,13 +23,7 @@ fi
|
||||
|
||||
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"
|
||||
fi
|
||||
|
||||
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
|
||||
git config --local --add safe.directory ${INPUT_DIRECTORY}
|
||||
|
||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user