-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We use this microblog for quick updates and announcements about #farm…
…OS. If you have something you'd like to share, let us know! https://farmos.discourse.group/t/accepting-suggestions-for-the-microblog/1716
- Loading branch information
Showing
3 changed files
with
53 additions
and
11 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 |
---|---|---|
|
@@ -5,23 +5,25 @@ on: | |
- cron: '0 9 8-14 * *' | ||
|
||
jobs: | ||
announce: | ||
build-message: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ssh-key: ${{ secrets.MICROBLOG_DEPLOY_KEY }} | ||
- name: Configure Git. | ||
run: | | ||
git config --global user.name 'farmOS' | ||
git config --global user.email '[email protected]' | ||
# We use `date +\%u` below in combination with the schedule cron rules | ||
# above to ensure these only run on the days they are meant to. | ||
- name: Announce calls | ||
- name: Build message | ||
run: | | ||
TZ=UTC | ||
DAY=$(date +\%u) | ||
case "${DAY}" in | ||
3) git commit --allow-empty -m 'The #farmOS monthly community call is today at 2pm Eastern. All are welcome! https://farmos.org/community/monthly-call/' ;; | ||
3) echo "MESSAGE=The #farmOS monthly community call is today at 2pm Eastern. All are welcome! https://farmos.org/community/monthly-call/" >> $GITHUB_ENV ;; | ||
esac | ||
git push origin main | ||
outputs: | ||
message: ${{ env.MESSAGE }} | ||
announce-call: | ||
uses: ./.github/workflows/create-message.yml | ||
needs: | ||
- build-message | ||
if: ${{ needs.build-message.outputs.message }} | ||
with: | ||
message: ${{ needs.build-message.outputs.message }} | ||
secrets: inherit |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Create message | ||
on: | ||
workflow_call: | ||
inputs: | ||
message: | ||
type: string | ||
required: true | ||
secrets: | ||
MICROBLOG_DEPLOY_KEY: | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
message: | ||
description: 'Message to announce' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
create-message: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Hard-code the repository. This is needed when this workflow is | ||
# triggered using workflow_call from other repositories. | ||
repository: farmOS/farmOS-microblog | ||
ssh-key: ${{ secrets.MICROBLOG_DEPLOY_KEY }} | ||
- name: Configure Git. | ||
run: | | ||
git config --global user.name 'farmOS' | ||
git config --global user.email '[email protected]' | ||
- name: Commit/push to farmOS-microblog. | ||
run: | | ||
git commit --allow-empty --cleanup=whitespace -F- << MESSAGE | ||
${{ inputs.message }} | ||
MESSAGE | ||
git push origin main |
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