Skip to content

Commit

Permalink
refactor: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon committed Mar 21, 2024
1 parent b29d36a commit 37f33d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ inputs:
default: 'origin'
```
### Outputs
```yaml
outputs:
commit:
description: 'The commit hash, if a commit was created'
```
## Development
### Release New Action Version
Expand Down
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ inputs:
required: true
default: 'origin'

outputs:
commit:
description: 'The commit hash, if a commit was created'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import {bot, exec, getInput, run} from './lib/actions.js'
// see https://github.com/actions/toolkit for more github actions libraries
import {bot, exec, getInput, run} from './lib/actions.js'
import {getCacheDetails, getCommitDetails, getRemoteUrl, readFile} from './lib/git.js'
import {createCommit, parseRepositoryFromUrl} from './lib/github.js'

Expand Down Expand Up @@ -61,6 +61,8 @@ export const action = () => run(async () => {
core.info('Syncing local repository ...')
await exec('git fetch', [input.remoteName, githubCommit.sha])
await exec('git reset', [githubCommit.sha])

core.setOutput('commit', githubCommit.sha)
})

if (import.meta.url === `file://${process.argv[1]}`) {
Expand Down

0 comments on commit 37f33d6

Please sign in to comment.