Skip to content

Commit

Permalink
commit change
Browse files Browse the repository at this point in the history
  • Loading branch information
reteps committed Oct 4, 2024
1 parent 1861514 commit 4a656fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/deploy-sigpwny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ jobs:
if: github.ref_name == github.event.repository.default_branch
run: npm run schedule-discord-workflow
shell: bash
working-directory: ${{ env.CI_WORKING_DIR }}
working-directory: ${{ env.CI_WORKING_DIR }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update workflow schedule"
file_pattern: "*.yml"
23 changes: 3 additions & 20 deletions sigpwny.com/src/scripts/schedule-discord-pings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { scheduleJobs, Job } from '@reteps/github-action-scheduler';
import fs from 'fs';
import path from 'path';
import { Client, GatewayIntentBits, Events, type GuildScheduledEventCreateOptions, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEvent, type GuildScheduledEventEditOptions, GuildScheduledEventStatus } from 'discord.js';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import duration from 'dayjs/plugin/duration';
import duration, { Duration } from 'dayjs/plugin/duration';
import advanced from 'dayjs/plugin/advancedFormat';
import { meetingMetadata } from '../utils/meetingMetadata';
dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.extend(duration);
Expand All @@ -22,26 +20,11 @@ const fetchMeetings = async () => {
}
}

const makeJob = (meeting: any, beforeDuration) => {
const makeJob = (meeting: Record<string, any>, beforeDuration: Duration) => {
const { data : { title, type, location, card_image, week_number, time_end, time_start, description }, body, filePath, slug } = meeting;

/*
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: latest
- run: npm ci
working-directory: sigpwny.com
- run: npm run send-discord-ping
working-directory: sigpwny.com
*/

const url = `https://sigpwny.com${slug}`;

const formattedDuration = dayjs.duration(beforeDuration).format('D [days] H [hours] m [minutes]');
const formattedDuration = beforeDuration.format('D [days] H [hours] m [minutes]');
const message = `**${title}** is in ${formattedDuration}!
${url}
`;
Expand Down

0 comments on commit 4a656fb

Please sign in to comment.