Skip to content

Commit

Permalink
update workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
O-Mutt committed Dec 28, 2023
1 parent 2f38e52 commit db81618
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/setup-node@v4
with:
fetch-depth: 2

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
main:
name: Semantic PR
runs-on: ubuntu-latest
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: amannn/[email protected]
id: lint_pr_title
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
push:
branches: [main]
pull_request:
Expand All @@ -19,12 +19,12 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: npm install, build, and test
run: |
npm install
Expand Down
36 changes: 21 additions & 15 deletions src/messageHandlers/plusplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,24 @@ module.exports = function plusplus(robot) {

if (message) {
msg.send(message);
robot.emit('plus-plus', {
notificationMessage: `<@${fromUser.slackId}> ${
operator.match(RegExpPlusPlus.positiveOperators) ? 'sent' : 'removed'
} a ${Helpers.capitalizeFirstLetter(robot.name)} point ${
operator.match(RegExpPlusPlus.positiveOperators) ? 'to' : 'from'
} <@${toUser.slackId}> in <#${room}>`,
sender: fromUser,
recipient: toUser,
direction: operator,
amount: 1,
room,
reason: cleanReason,
msg,
});
robot.emit('plus-plus', [
{
notificationMessage: `<@${fromUser.slackId}> ${
operator.match(RegExpPlusPlus.positiveOperators)
? 'sent'
: 'removed'
} a ${Helpers.capitalizeFirstLetter(robot.name)} point ${
operator.match(RegExpPlusPlus.positiveOperators) ? 'to' : 'from'
} <@${toUser.slackId}> in <#${room}>`,
sender: fromUser,
recipient: toUser,
direction: operator,
amount: 1,
room,
reason: cleanReason,
msg,
},
]);
}
}

Expand Down Expand Up @@ -186,6 +190,7 @@ module.exports = function plusplus(robot) {

let messages = [];
let fromUser;
const pointEmits = [];
for (let i = 0; i < cleanNames.length; i++) {
to[i].name = cleanNames[i];
let toUser;
Expand All @@ -208,7 +213,7 @@ module.exports = function plusplus(robot) {
messages.push(
MessageFactory.BuildNewScoreMessage(toUser, cleanReason, robot),
);
robot.emit('plus-plus', {
pointEmits.push({
notificationMessage: `<@${fromUser.slackId}> ${
operator.match(RegExpPlusPlus.positiveOperators)
? 'sent'
Expand All @@ -226,6 +231,7 @@ module.exports = function plusplus(robot) {
});
}
}
robot.emit('plus-plus', pointEmits);
messages = messages.filter((message) => !!message); // de-dupe

robot.logger.debug(`These are the messages \n ${messages.join('\n')}`);
Expand Down

0 comments on commit db81618

Please sign in to comment.