-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
name: Send a toot to Mastodon when you post a new blog post | ||
|
||
on: [pull_request] | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
post: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
RECENTLY_ADDED_FILES=$(git log -1 --stat --grep=publish --oneline --name-only | tr '\n' ' ') | ||
echo $RECENTLY_ADDED_FILES | ||
echo "RECENTLY_ADDED_FILES=$RECENTLY_ADDED_FILES" >> $GITHUB_ENV | ||
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
timeout-minutes: 10 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
ref: ${{ github.ref_name }} | ||
- run: | | ||
RECENTLY_ADDED_FILES=$(git log -1 --stat --oneline --name-only --pretty=format:'%s | %b' | tr '\n' ' ') | ||
echo $RECENTLY_ADDED_FILES | ||
echo "RECENTLY_ADDED_FILES=$RECENTLY_ADDED_FILES" >> $GITHUB_ENV | ||
- name: Post to Mastodon | ||
uses: sumit4613/post-to-mastodon@main | ||
if: "contains(github.event.head_commit.message, 'publish')" | ||
with: | ||
message: "Hello, folks! I just posted a new blog post. Check it out!" | ||
base-blog-url: "https://sumit4613.github.io/posts/" | ||
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} | ||
host: "fosstodon.org" | ||
port: "443" | ||
api: "api/v1" | ||
- name: Post to Mastodon | ||
uses: sumit4613/post-to-mastodon@main | ||
with: | ||
message: "Hello, folks! I just posted a new blog post. Check it out!" | ||
base-blog-url: "https://sumit4613.github.io/posts/" | ||
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} | ||
host: "fosstodon.org" | ||
port: "443" | ||
api: "api/v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
new change | ||
|
||
another change | ||
let's see if action works or not |