Skip to content

Idea: inform when publishing the same twice #140

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
webpro opened this issue Jul 9, 2024 · 8 comments · Fixed by #144
Closed

Idea: inform when publishing the same twice #140

webpro opened this issue Jul 9, 2024 · 8 comments · Fixed by #144

Comments

@webpro
Copy link
Contributor

webpro commented Jul 9, 2024

Since the example/template has on: [push, pull_request] the job also runs on tags, resulting in two seemingly identical publishes for the same commit sha:

Nothing wrong here, but maybe nice to info/warn something like "this version was already published".

In the same vein, the Action template could be updated to something like this:

on:
  pull_request:
  push:
    branches:
      - '**'
    tags:
      - '!**'

Tags are usually published to npm anyway. Each push would still be published, though.

@Aslemammad
Copy link
Member

That's for sure! Thank you so much for the suggestion, would you like to send a PR?

@webpro
Copy link
Contributor Author

webpro commented Jul 9, 2024

As much as I'd love to help out, I have more projects on my plate atm.

@Aslemammad
Copy link
Member

For sure mate, will sort it out for you!

@Aslemammad
Copy link
Member

Just sorted this out, will have a release soon!

@webpro
Copy link
Contributor Author

webpro commented Jul 16, 2024

Thank you! Couldn't wish for more 😊

@David-Pena
Copy link
Contributor

Hi @Aslemammad @webpro I have a question about the implementation of this ⬆️

if I have this

on:
  push:
    branches: 
      - main
  pull_request:
    types: [closed]
    branches: 
      - main

Whats suggested in this issue is that I update the template to this ⬇️ ?

on:
  push:
    branches: 
      - '**'
    tags
      - '!**'
  pull_request:
    types: [closed]
    branches: 
      - '**'
    tags
      - '!**'

I know it might be a silly question but its for an OSS repo so I wouldnt want to suggest something wrong 👀

@webpro
Copy link
Contributor Author

webpro commented Sep 9, 2024

From https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push:

Runs your workflow when you push a commit or tag

With the suggested config the workflow should not be triggered for any tag. I think we have to explicitly disable the tag part.

But I wouldn't worry too much about it, a mistake would be rather cheap here as this service itself is about publishing preview releases :)

@David-Pena
Copy link
Contributor

Got it @webpro thanks for your reply 🙌

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.

3 participants