Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Run anywhere #3

Merged
merged 6 commits into from
Sep 10, 2020
Merged

Run anywhere #3

merged 6 commits into from
Sep 10, 2020

Conversation

notlmn
Copy link
Collaborator

@notlmn notlmn commented Aug 30, 2020

Closes #1

  • Run on events other than pushing tags
  • Allow user to pass in a tag input
  • Take token from input instead of ENV

@notlmn notlmn requested a review from fregante August 30, 2020 09:42
Copy link
Owner

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have time to test this, but if you add it to RGH even as a user/action#commit we could test it tomorrow.

readme.md Outdated Show resolved Hide resolved
distribution/index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@@ -22,16 +16,25 @@ async function run() {
const {stdout: t} = await execFile('git', ['tag', '-l', '--sort=-creatordate']);
const tags = t.split('\n').filter(Boolean).map(tag => tag.trim());

if (tags.length === 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it doesn't seem to support creating a release for the first tag (which is usually just "Initial release"), so this condition should reflect that, at least for the time being.

Suggested change
if (tags.length === 0) {
if (tags.length < 2) {

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unchanged. Did you add support for "initial release" in the commit?

Copy link
Collaborator Author

@notlmn notlmn Sep 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for "initial release" has been there the whole time.

If there is only one tag, then we compare that with the root commit (initial commit) we can find.

image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this to be just Initial release but that works too, for the time being

@fregante
Copy link
Owner

fregante commented Sep 8, 2020

Looks good, but can test this PR on refined-github/refined-github#3421, refined-github/github-url-detection#30 or fregante/browser-extension-template#37?

So we're sure it works the way we want it to work.

@notlmn
Copy link
Collaborator Author

notlmn commented Sep 8, 2020

Will try this on fregante/browser-extension-template#37, as that looks like the best place to test this stuff without polluting other repositories.

@fregante fregante added the enhancement New feature or request label Sep 10, 2020
@notlmn notlmn merged commit 93377b2 into main Sep 10, 2020
@notlmn notlmn deleted the run-anywhere branch September 10, 2020 13:44
@notlmn notlmn mentioned this pull request Sep 10, 2020
3 tasks
fregante added a commit that referenced this pull request Sep 10, 2020
This reverts commit 93377b2.
@@ -66,7 +72,7 @@ async function run() {
releaseBody.push(`\n[\`${range}\`](https://github.com/${owner}/${repo}/compare/${range})`);
}

const octokit = getOctokit(process.env.RELEASE_TOKEN);
const octokit = getOctokit(core.getInput('token'));
Copy link
Owner

@fregante fregante Oct 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use this package to automatically pickup the token: https://github.com/octokit/action.js

The readme doesn’t show with.token support but I just added it in a dependency: octokit/auth-action.js#106

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds cool, do you want me to add this to #22?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn’t sound related 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support running this right after creating a tag in a workflow
2 participants