mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-24 05:25:18 +00:00
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/github-script](https://redirect.github.com/actions/github-script) | action | pinDigest | → `f28e40c` | | [actions/setup-python](https://redirect.github.com/actions/setup-python) | action | pinDigest | → `a26af69` | | [namespacelabs/nscloud-cache-action](https://redirect.github.com/namespacelabs/nscloud-cache-action) | action | pinDigest | → `a90bb5d` | | [taiki-e/install-action](https://redirect.github.com/taiki-e/install-action) | action | pinDigest | → `921e2c9` | | [taiki-e/install-action](https://redirect.github.com/taiki-e/install-action) | action | pinDigest | → `b4f2d5c` | | [withastro/automation](https://redirect.github.com/withastro/automation) | action | pinDigest | → `a5bd0c5` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/15138) for more information. --- ### Configuration 📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone America/New_York, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- Release Notes: - N/A <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My45MS41IiwidXBkYXRlZEluVmVyIjoiNDMuOTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Marshall Bowers <git@maxdeviant.com>
64 lines
2.2 KiB
YAML
64 lines
2.2 KiB
YAML
name: Congratsbot
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
check-author:
|
|
if: ${{ github.repository_owner == 'zed-industries' }}
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
outputs:
|
|
should_congratulate: ${{ steps.check.outputs.should_congratulate }}
|
|
steps:
|
|
- name: Get PR info and check if author is external
|
|
id: check
|
|
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
|
|
with:
|
|
github-token: ${{ secrets.CONGRATSBOT_GITHUB_TOKEN }}
|
|
script: |
|
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
commit_sha: context.sha
|
|
});
|
|
|
|
if (prs.length === 0) {
|
|
core.setOutput('should_congratulate', 'false');
|
|
return;
|
|
}
|
|
|
|
const mergedPR = prs.find(pr => pr.merged_at !== null) || prs[0];
|
|
|
|
if (mergedPR.user.type === "Bot") {
|
|
// They are a good bot, but not good enough to be congratulated
|
|
core.setOutput('should_congratulate', 'false');
|
|
return;
|
|
}
|
|
|
|
const prAuthor = mergedPR.user.login;
|
|
|
|
try {
|
|
await github.rest.teams.getMembershipForUserInOrg({
|
|
org: 'zed-industries',
|
|
team_slug: 'staff',
|
|
username: prAuthor
|
|
});
|
|
core.setOutput('should_congratulate', 'false');
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
core.setOutput('should_congratulate', 'true');
|
|
} else {
|
|
console.error(`Error checking team membership: ${error.message}`);
|
|
core.setOutput('should_congratulate', 'false');
|
|
}
|
|
}
|
|
|
|
congrats:
|
|
needs: check-author
|
|
if: needs.check-author.outputs.should_congratulate == 'true'
|
|
uses: withastro/automation/.github/workflows/congratsbot.yml@a5bd0c5748c4d56e687cdd558064f9ee8adfb1f2 # main
|
|
with:
|
|
EMOJIS: 🎉,🎊,🧑🚀,🥳,🙌,🚀,🦀,🔥,🚢
|
|
secrets:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|