scientific-python / circleci-artifacts-redirector-action

GitHub Action to add a GitHub status link to a CircleCI artifact.
MIT License
14 stars 8 forks source link

Support custom job title #16

Closed NicolasHug closed 3 years ago

NicolasHug commented 3 years ago

Thanks for this great tool!!

Currently the Action job always renders as "<the circleCI job name> artifact". This PR allows to customize this.

I'm not sure how to test the proposed changes - I don't have a personal repo with some circle CI jobs where I could test this. Any chance you have something set up already ^^ ?

Thanks!

NicolasHug commented 3 years ago

Oh, there seem to be a lot of deleted lines. I'm not sure what I did wrong? I just ran ncc build index.js as instructed. My ncc version is 0.28.3

larsoner commented 3 years ago

I'm not sure how to test the proposed changes - I don't have a personal repo with some circle CI jobs where I could test this. Any chance you have something set up already ^^ ?

Let's use this one :) I didn't have "Build forked pull requests" enabled for CircleCI, but I enabled them so a close-reopen made it run, and redirect properly to the trivial CircleCI artifact.

In theory if you modify .github/workflows/main.yml in this PR it might work... if it doesn't, then I'll probably try pushing your commits as a new branch, which might work instead.

larsoner commented 3 years ago

Regarding the lines deleted I have no idea, maybe it's supposed to be that way?

larsoner commented 3 years ago

I'll push as a branch and we'll see if it shows up...

larsoner commented 3 years ago

Looks like that didn't work either:

Screenshot from 2021-04-23 10-34-56

larsoner commented 3 years ago

I think you need to add an entry to

https://github.com/larsoner/circleci-artifacts-redirector-action/blob/master/action.yml

larsoner commented 3 years ago

Okay I think we're suffering from a problem where it only ever builds using the main branch for some reason -- even this branch where I pushed your commits, changed the text to be + ' ARTIFACT' still shows the lower-case one:

Screenshot from 2021-04-23 10-52-55

I'm tempted to merge your PR and just see what the main build looks like, quickly reverting if it's wrong. It's a terrible dev process but it might get the job done :)

larsoner commented 3 years ago

https://github.com/larsoner/circleci-artifacts-redirector-action/commit/eb35dec392c9f10374fff50a731c64cb69bcff2a :)

NicolasHug commented 3 years ago

lol we had the same idea.

empted to merge your PR and just see what the main build looks like, quickly reverting if it's wrong.

OK! sorry for the noise, I can't say I really understand what I'm doing TBH!

larsoner commented 3 years ago

Ohhh of course it won't run on PRs because it's on [status] not on push etc.

One thing you could do actually is to merge this / push these changes to your master branch in your fork. You should be able to see it take effect there on the main page like I've been doing.

larsoner commented 3 years ago

You'll need to enable GH actions for your fork, though...

larsoner commented 3 years ago

Presumably in https://github.com/NicolasHug/circleci-artifacts-redirector-action/settings/actions

NicolasHug commented 3 years ago

I'll need CircleCI to be be set up too won't I?

larsoner commented 3 years ago

Ohh yes. Just 1000 simple steps

https://app.circleci.com/projects/project-dashboard/github/NicolasHug/

larsoner commented 3 years ago

Looks like maybe all of those deleted lines mattered (?)

https://github.com/NicolasHug/circleci-artifacts-redirector-action/runs/2420854112?check_suite_focus=true

Error: Cannot find module '@actions/core'

Maybe there are a ton of deleted lines because you don't have the GitHub actions "stuff" installed on your system? I'll look back through the docs...

larsoner commented 3 years ago

You might just need to do npm install before your ncc build index.js call

larsoner commented 3 years ago

The diff somehow got crazier but this is nice:

Screenshot from 2021-04-23 11-20-08

Merging, thanks for sticking with it @NicolasHug !

NicolasHug commented 3 years ago

Thanks for your patience! :)