Skip to content

Commit

Permalink
Update to use new set-output standard
Browse files Browse the repository at this point in the history
  • Loading branch information
keylogic1 committed Feb 3, 2023
1 parent 8780ffd commit 51755f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ Retrieve git sha from a remote repository
## Usage
### Public repository
```
uses: mego22/actions-git-sha@main
uses: keylogic1/actions-git-sha@main
with:
repo: "https://github.com/mego22/dotfiles.git"
repo: "https://github.com/keylogic1/dotfiles.git"
```

### Private repository
```
uses: mego22/actions-git-sha@main
uses: keylogic1/actions-git-sha@main
with:
username: "${{ github.actor }}"
password: "${{ secrets.TOKEN }}"
repo: "https://github.com/mego22/git-sha-test.git"
repo: "https://github.com/keylogic1/git-sha-test.git"
```

### Non-default branch
```
uses: mego22/actions-git-sha@main
uses: keylogic1/actions-git-sha@main
with:
repo: "https://github.com/mego22/dotfiles.git"
repo: "https://github.com/keylogic1/dotfiles.git"
branch: "git-sha-test"
```

### Using the output in a later step
```
- name: Retrieve sha from a repo
id: remote_sha
uses: mego22/actions-git-sha@main
uses: keylogic1/actions-git-sha@main
with:
repo: "https://github.com/mego22/dotfiles.git"
repo: "https://github.com/keylogic1/dotfiles.git"
- name: Print sha
run: echo "The sha is ${{ steps.remote_sha.outputs.sha }}"
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ git config --global credential.helper store

SHA=`git ls-remote "${GIT_REPO}" "${GIT_BRANCH}" | awk '{print $1}'`

echo "::set-output name=sha::$SHA"
echo "{sha}={$SHA}" >> $GITHUB_OUTPUT

0 comments on commit 51755f2

Please sign in to comment.