actions-gh-pages icon indicating copy to clipboard operation
actions-gh-pages copied to clipboard

output final commit sha

Open trim21 opened this issue 5 years ago • 5 comments

Is your feature request related to a problem? Please describe

No

Describe the solution you'd like

core.setOutput('sha', sha)

so user can access this commit by ${{ steps.gh-pages.outputs.sha}}

Describe alternatives you've considered

Additional context

trim21 avatar Jun 11 '20 20:06 trim21

Thank you for suggesting this!

Yes. That looks useful. A longer option name may be easier to understand as follows.

core.setOutput('pages_commit_hash', sha);

I also considered the following output parameter names.

  • published_commit_hash
  • deployed_commit_hash
  • generated_commit_hash

We want to differentiate a publish_branch's commit hash from source branch's one. Does anybody have any better ideas of the output parameter name? Please tell us here!

I will work on this with #300, #344, and others.

peaceiris avatar Jun 12 '20 04:06 peaceiris

How about src_sha and dst_sha?

sidvishnoi avatar Jun 15 '20 16:06 sidvishnoi

Cool!

We already have ${{ github.sha }} in the GitHub Actions contexts. (src_sha)

The GitHub Actions context uses github.sha so we will choose dst_sha. (destination)

Thanks @sidvishnoi

peaceiris avatar Jun 16 '20 03:06 peaceiris

Could someone test #514 as follows?

- name: Deploy
  uses: peaceiris/actions-gh-pages@7e55c73 #514
  id: pages
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}

- run: echo ${{ steps.pages.outputs.dst_sha }}

peaceiris avatar Oct 11 '20 07:10 peaceiris

Could someone test #514 as follows?

I tested this on a current workflow I'm using for an Hugo site and it works as expected :+1:

Thanks a lot for this feature!

pabluk avatar Oct 21 '20 21:10 pabluk