Skip to repository content68 lines · 2.3 KB · yaml
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T01:27:43.642Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
congrats.yml
1name: Congratsbot
2
3on:
4 push:
5 branches: [main]
6
7permissions:
8 contents: read
9
10jobs:
11 check-author:
12 if: ${{ github.repository_owner == 'zed-industries' }}
13 runs-on: namespace-profile-2x4-ubuntu-2404
14 outputs:
15 should_congratulate: ${{ steps.check.outputs.should_congratulate }}
16 steps:
17 - name: Get PR info and check if author is external
18 id: check
19 uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
20 with:
21 github-token: ${{ secrets.CONGRATSBOT_GITHUB_TOKEN }}
22 script: |
23 const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
24 owner: context.repo.owner,
25 repo: context.repo.repo,
26 commit_sha: context.sha
27 });
28
29 if (prs.length === 0) {
30 core.setOutput('should_congratulate', 'false');
31 return;
32 }
33
34 const mergedPR = prs.find(pr => pr.merged_at !== null) || prs[0];
35
36 if (mergedPR.user.type === "Bot") {
37 // They are a good bot, but not good enough to be congratulated
38 core.setOutput('should_congratulate', 'false');
39 return;
40 }
41
42 const prAuthor = mergedPR.user.login;
43
44 try {
45 await github.rest.teams.getMembershipForUserInOrg({
46 org: 'zed-industries',
47 team_slug: 'staff',
48 username: prAuthor
49 });
50 core.setOutput('should_congratulate', 'false');
51 } catch (error) {
52 if (error.status === 404) {
53 core.setOutput('should_congratulate', 'true');
54 } else {
55 console.error(`Error checking team membership: ${error.message}`);
56 core.setOutput('should_congratulate', 'false');
57 }
58 }
59
60 congrats:
61 needs: check-author
62 if: needs.check-author.outputs.should_congratulate == 'true'
63 uses: withastro/automation/.github/workflows/congratsbot.yml@a5bd0c5748c4d56e687cdd558064f9ee8adfb1f2 # main
64 with:
65 EMOJIS: 🎉,🎊,🧑🚀,🥳,🙌,🚀,🦀,🔥,🚢
66 secrets:
67 DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
68