Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1027981

Browse filesBrowse files
authored
Merge pull request #249 from mvolfik/feat/automatic-newsletter
Automate notification about new monthly issue
2 parents 8922bcf + 2d2e504 commit 1027981
Copy full SHA for 1027981

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎.github/workflows/build-site.yml

Copy file name to clipboardExpand all lines: .github/workflows/build-site.yml
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'rust-osdev/homepage'
6767
permissions:
6868
contents: write
69+
issues: write
6970

7071
steps:
7172
- name: "Download Generated Site"
@@ -99,6 +100,17 @@ jobs:
99100
git commit --allow-empty -m "Deploy ${GITHUB_SHA}
100101
101102
Deploy of commit https://github.com/rust-osdev/homepage/commit/${GITHUB_SHA}"
103+
104+
if git show HEAD --summary | grep -P 'create mode \d+ this-month/\d{4}-\d{2}/index.html'
105+
then
106+
# This might do something weird if there are multiple such pages. Hopefully that should never happen.
107+
new_page=$(git show HEAD --summary | grep -P 'create mode \d+ this-month/\d{4}-\d{2}/index.html' | cut -d' ' -f5)
108+
echo "Detected a new monthly page:" $new_page
109+
curl -s -X POST \
110+
https://api.github.com/repos/rust-osdev/homepage/issues/212/comments \
111+
-d "{\"body\":\"New issue published: [**$new_page**](https://rust-osdev.com/$new_page). Beep boop.\"}" \
112+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
113+
fi
102114
working-directory: "gh-pages"
103115

104116
- name: "Show Changes"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.