burnex
burnex copied to clipboard
Automatically update emails list
Hello.
I found a beautiful solution of automatic updates of emails.txt file using Github Actions. Here is the source: https://github.com/lindell/go-burner-email-providers/blob/main/.github/workflows/build.yaml
How it works:
- Github Actions is starting every day
- Emails.txt file is being downloaded from the source repo
- If nothing has been changed, the workflow is finished
- Otherwise the latest tag is being fetched, e.g. 3.1.0
- Patch part of the version number will be increased, e.g. 3.1.1
- Updated file will be commited to the master branch with a new tag
- New Github release will be created for this tag
- New version will then be uploaded into hex.pm
There are 2 things that should be done:
- Add up new repo secret PERSONAL_TOKEN. Here should be stored a Github Private token with scope
repo
. It will be used to push new commit with updated emails list, and also pushing new tags. DefaultGITHUB_TOKEN
is not suitable here because it does not trigger workflows which is important for making automatic releases. - Add up new repo secret HEX_API_KEY. Here should be stored the result of call
mix hex.user key generate --permission api:write
. It will be used to publish new package releases.
I've changed the event in release.yml
from push:tag
to workflow_dispatch
. It means that this step could only be started via REST API call, so you can test it manually.
@Betree Could you please take a look?
This is a really good idea and quite necessary for this lib (I think).
@dolfinus I see on your branch that the github actions have not run for a few months. https://github.com/wesbos/burner-email-providers was updated 25 days ago with a new list. I thought the github actions would update with this new list? Am I missing something? Do the actions only run every day on master
?
Hi.
github actions have not run for a few months
I've disabled this action just to stop it from adding new commits and making this PR full of unrelated changes.
I could create another branch with the same change to demonstrate the workflow if you wish.
Hi.
github actions have not run for a few months
I've disabled this action just to stop it from adding new commits and making this PR full of unrelated changes.
I could create another branch with the same change to demonstrate the workflow if you wish.
No need to create another branch. I understand. I hope this gets approved and merged.
I've added a workflow_dispatch
rule to sync
workflow, so now it can be run manually from Github Actions UI.
Example run of the sync
job:
https://github.com/dolfinus/burnex/runs/4059966780?check_suite_focus=true
Example run of the triggered by commit tests
job (it is failing because email.txt was updated a lot since last commit in the master branch) :
https://github.com/dolfinus/burnex/actions/runs/1404664889
This run generated a new tag 3.1.1: https://github.com/dolfinus/burnex/releases/tag/3.1.1
@Betree Can this be merged please? It would be a great addition.