-
Notifications
You must be signed in to change notification settings - Fork 23
40 lines (34 loc) · 1.33 KB
/
release-news.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Release News Workflow
on:
# Allow manually starting the workflow incase we need human intervention.
workflow_dispatch:
# Runs at 08:17 UTC / 00:17 PST / 01:17 PDT
# 17 is an arbitrarily chosen to avoid running the workflow during the peak at the beginning of the hour
schedule:
- cron: '17 8 * * *'
permissions: write-all
jobs:
generate_news_items:
# If this is running in a fork, only run if manually dispatched.
if: github.repository == 'amazon-ion/ion-docs' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# This is needed so that the deploy workflow will be triggered for news release commits.
# See https://github.com/orgs/community/discussions/26220
persist-credentials: false
- name: Generate News Posts
id: generate_news
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./_scripts/generate_release_news.sh
- name: Commit and Push Changes
if: ${{ steps.generate_news.outputs.changes > 0 }}
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -m "${{ steps.generate_news.outputs.generated_commit_message }}"
git push