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

Already on GitHub? Sign in to your account

Send nostr note when PR is merged #1677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anurag-l1nt
Copy link

@anurag-l1nt anurag-l1nt commented Jan 9, 2025

This PR includes the configuration and necessary scripts for a GitHub Action that posts a note on Nostr when a PR is merged. The note will include the user who created the PR (being mentioned with their Nostr pubkey if one is configured in the "socials" section of their profile), the title of the PR, and a link to it

For the execution to work correctly, the following variables and secrets need to be set in the repository:

  • NOSTR_RELAYS: Environment variable with a list of relays where the note will be sent, separated by commas. For example: wss://nos.lol,wss://relay.damus.io
  • NOSTR_PRIVATE_KEY: Secret containing the private key in hexadecimal format that will be used to publish the note.

I must mention @laanwj , whose code from their ghi repository I partially used for the scripts.

@kehiy
Copy link
Contributor

kehiy commented Jan 9, 2025

nice change. can't we create another repo that listens to these changes?

@AsaiToshiya
Copy link
Collaborator

I remember there are some bots that post NIPs changes.

@anurag-l1nt
Copy link
Author

nice change. can't we create another repo that listens to these changes?

Not the way I’ve implemented it. GitHub Actions run within a specific repository, and this particular one is triggered upon merging a PR. To achieve this in another repository, a scheduled action would be needed that runs at regular intervals and periodically queries the GitHub API to check for changes. It would be a different and more complex approach.

If the admins of this repo have no objections to adding the GitHub Action, I believe it’s a simpler and cleaner solution.

@anurag-l1nt
Copy link
Author

I remember there are some bots that post NIPs changes.

I knew there were bots that sent notes to Nostr about PR merges for BIPs, Bitcoin Core, and others, but I wasn’t aware of any for NIPs. At the time, I had searched and couldn’t find any (which doesn’t mean they don’t exist).

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 this pull request may close these issues.

3 participants