Skip to content

Commit 4859b1a

Browse files
authored
Merge branch 'main' into ducky-bober-emoji
2 parents ead6712 + d85f627 commit 4859b1a

14 files changed

Lines changed: 62 additions & 52 deletions

File tree

.github/workflows/event-validation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414

1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v5
2121
with:
22-
python-version: 3.8
22+
python-version: 3.12
2323

2424
- name: Install dependencies
2525
run: python -m pip install -r events/requirements.txt
@@ -46,7 +46,7 @@ jobs:
4646
- name: Upload a Build Artifact
4747
if: always() && steps.prepare-artifact.outcome == 'success'
4848
continue-on-error: true
49-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v4
5050
with:
5151
name: pull-request-payload
5252
path: pull_request_payload.json

.github/workflows/status-embed.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@ on:
77
types:
88
- completed
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
status_embed:
12-
# We need to send a status embed whenever the workflow
13-
# sequence we're running terminates. There are a number
14-
# of situations in which that happens:
15-
#
16-
# 1. We reach the end of the Event Validation workflow, without
17-
# it being skipped.
18-
#
19-
# 2. A `pull_request` triggered a Lint & Test workflow,
20-
# as the sequence always terminates with one run.
21-
#
22-
# 3. If any workflow ends in failure or was cancelled.
23-
if: >-
24-
(github.event.workflow_run.name == 'Event Validation' && github.event.workflow_run.conclusion != 'skipped') ||
25-
github.event.workflow_run.event == 'pull_request' ||
26-
github.event.workflow_run.conclusion == 'failure' ||
27-
github.event.workflow_run.conclusion == 'cancelled'
2816
name: Send Status Embed to Discord
2917
runs-on: ubuntu-latest
3018

@@ -39,13 +27,13 @@ jobs:
3927
curl -s -H "Authorization: token $GITHUB_TOKEN" ${{ github.event.workflow_run.artifacts_url }} > artifacts.json
4028
DOWNLOAD_URL=$(cat artifacts.json | jq -r '.artifacts[] | select(.name == "pull-request-payload") | .archive_download_url')
4129
[ -z "$DOWNLOAD_URL" ] && exit 1
42-
wget --quiet --header="Authorization: token $GITHUB_TOKEN" -O pull_request_payload.zip $DOWNLOAD_URL || exit 2
30+
curl -sSL -H "Authorization: token $GITHUB_TOKEN" -o pull_request_payload.zip $DOWNLOAD_URL || exit 2
4331
unzip -p pull_request_payload.zip > pull_request_payload.json
4432
[ -s pull_request_payload.json ] || exit 3
45-
echo "::set-output name=pr_author_login::$(jq -r '.user.login // empty' pull_request_payload.json)"
46-
echo "::set-output name=pr_number::$(jq -r '.number // empty' pull_request_payload.json)"
47-
echo "::set-output name=pr_title::$(jq -r '.title // empty' pull_request_payload.json)"
48-
echo "::set-output name=pr_source::$(jq -r '.head.label // empty' pull_request_payload.json)"
33+
echo "pr_author_login=$(jq -r '.user.login // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
34+
echo "pr_number=$(jq -r '.number // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
35+
echo "pr_title=$(jq -r '.title // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
36+
echo "pr_source=$(jq -r '.head.label // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
4937
env:
5038
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5139

@@ -54,20 +42,18 @@ jobs:
5442
# more information and we can fine tune when we actually want
5543
# to send an embed.
5644
- name: GitHub Actions Status Embed for Discord
57-
uses: SebastiaanZ/github-status-embed-for-discord@v0.2.1
45+
uses: SebastiaanZ/github-status-embed-for-discord@v0.3.0
5846
with:
5947
# Our GitHub Actions webhook
6048
webhook_id: '784184528997842985'
6149
webhook_token: ${{ secrets.GHA_WEBHOOK_TOKEN }}
6250

63-
# Workflow information
51+
# We need to provide the information of the workflow that
52+
# triggered this workflow instead of this workflow.
6453
workflow_name: ${{ github.event.workflow_run.name }}
6554
run_id: ${{ github.event.workflow_run.id }}
6655
run_number: ${{ github.event.workflow_run.run_number }}
6756
status: ${{ github.event.workflow_run.conclusion }}
68-
actor: ${{ github.actor }}
69-
repository: ${{ github.repository }}
70-
ref: ${{ github.ref }}
7157
sha: ${{ github.event.workflow_run.head_sha }}
7258

7359
pr_author_login: ${{ steps.pr_info.outputs.pr_author_login }}
21.1 KB
Loading
Lines changed: 26 additions & 0 deletions
Loading

events/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ start_date: July 10
2323
end_date: July 20
2424
```
2525
26-
There must be exactly 1 fallback event, and 0 or more non-fallback events. Events cannot collide in time, and the end date must either be equal to the start date (1 day event) or chronologically subsequent. Both bounds are inclusive, and the format shown in the example above must be followed.
26+
There must be exactly 1 fallback event, and 0 or more non-fallback events. For single-day events, `end_date` must be equal to `start_date`. If `start_date` is a later day in the year than `end_date`, the event is interpreted as starting in one year and ending in the next. Both bounds are inclusive, and the format shown in the example above must be followed.
2727

2828
The markdown section of the meta file then contains the event's description. Descriptions are made available directly in the Discord guild as embeds sent by the Python bot. For formatting, use Discord's watered down Markdown ~ keep in mind that e.g. the `#` symbol does not create a heading.
2929

events/diwali/meta.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
start_date: November 8
3-
end_date: November 14
2+
start_date: November 1
3+
end_date: November 4
44
---
55
**Diwali**
66

events/easter/meta.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
start_date: April 3
3-
end_date: April 10
2+
start_date: March 30
3+
end_date: April 1
44
---
55
**Easter**
66

events/eid_al_fitr/meta.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
start_date: April 20
3-
end_date: April 21
2+
start_date: April 9
3+
end_date: April 13
44
---
55

66
**Eid al-Fitr**

events/halloween/meta.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
start_date: October 26
3-
end_date: November 1
2+
start_date: October 30
3+
end_date: October 31
44
---
55
**Halloween**
66

events/holi/meta.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
start_date: March 7
3-
end_date: March 13
2+
start_date: March 23
3+
end_date: March 26
44
---
55
**Holi**
66

0 commit comments

Comments
 (0)