Skip to content

Create Monthly D5 Update Issue #28

Create Monthly D5 Update Issue

Create Monthly D5 Update Issue #28

name: Create Monthly D5 Update Issue
on:
workflow_dispatch:
schedule:
# 16:16 UTC on the 1st of every month
- cron: 16 16 1 * *
jobs:
create-monthly-d5-issue:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
# Get last month's name as a variable
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-output-parameter
- id: set_output
run: |
echo "month=$(date -d 'last month' +%B)" >> $GITHUB_OUTPUT
- id: create_issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The `--body-file -` option below uses the multiline content from stdin for the body.
# See: https://github.com/cli/cli/issues/595
run: |
echo -e "## To-Do\n\n- [ ] Inform D5 transit reps of any updates regarding district agencies or relevant Cal-ITP news from ${{ steps.set_output.outputs.month }}" | \
gh issue create \
--title "Send monthly update to D5 for ${{ steps.set_output.outputs.month }}" \
--body-file - \
--label "reporting" \
--assignee o-ram,laneymangan \
--repo $GITHUB_REPOSITORY