Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call @actions/core setOutput with created tag #8

Closed
JasonEtco opened this issue May 16, 2020 · 3 comments 路 Fixed by #43
Closed

Call @actions/core setOutput with created tag #8

JasonEtco opened this issue May 16, 2020 · 3 comments 路 Fixed by #43

Comments

@JasonEtco
Copy link

馃憢 @bcoe! Following up on this Twitter conversation. It'd be rad if this action called @actions/core's setOutput method, to use the tag that was created in the next actions in a workflow. I'm not sure where that's exposed, but if you can point me to it, happy to open a PR. It'd look something like this:

const release = ReleasePRFactory.build(...)
await release.run()

// Assuming it's exposed on `ReleasePRFactory.tag_name`:
core.setOutput('tag_name', release.tag_name)

This would pair nicely with build-and-tag-action's tag_name input!

@bcoe
Copy link
Contributor

bcoe commented May 18, 2020

@JasonEtco I don't think it does so yet, but we could make this line:

https://github.com/bcoe/release-please-action/blob/master/index.js#L20

Return the tag of a release, if one is created?

@JasonEtco
Copy link
Author

Nice, thanks for that @bcoe. I think this would also require an upstream change to googleapis/release-please, specifically here:

https://github.com/googleapis/release-please/blob/42e5bc6b8654afd4ce41e4c81333e1cf3bce75a5/src/github-release.ts#L81-L86

GitHubRelease#createRelease doesn't return or otherwise expose the generated release, or the tag (ex: we could get it from the release PR over here). I can open those two PRs (one there, one here) if you'd like! They'd be pretty simple:

class GitHubRelease {
  async createRelease() {
    // ...
-      await this.gh.createRelease(
+      const release = await this.gh.createRelease(
        this.packageName,
        gitHubReleasePR.version,
        gitHubReleasePR.sha,
        latestReleaseNotes
      );
   // ...
+  return release
}
- await gr.createRelease()
+ const release = await gr.createRelease()
+ core.setOutput('tag_name', release.tag_name)

@bcoe
Copy link
Contributor

bcoe commented May 21, 2020

@JasonEtco bumped into a couple issues and had to rollback:

  1. unfortunately need all the contents of the dist/ folder.
  2. release please currently looks at the sha of the last tag released to determine what commits have landed since the last release, since build-and-tag-actions forces a new sha this causes issues with the algorithm (I'm looking at changing this behavior to instead use the sha of the release that was last merged).

mmarchini added a commit to mmarchini/release-please-action that referenced this issue Jul 22, 2020
mmarchini added a commit to mmarchini/release-please-action that referenced this issue Jul 22, 2020
mmarchini added a commit to mmarchini/release-please-action that referenced this issue Jul 23, 2020
The tag name is useful to interact with the release on following steps,
and the upload url is useful to upload assets to the release.

Fix: googleapis#8
Fix: googleapis#41
@bcoe bcoe closed this as completed in #43 Jul 23, 2020
bcoe pushed a commit that referenced this issue Jul 23, 2020
The tag name is useful to interact with the release on following steps,
and the upload url is useful to upload assets to the release.

Fix: #8
Fix: #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants