File: weekly-changelog.yml

package info (click to toggle)
cataclysm-dda 0.H-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 710,808 kB
  • sloc: cpp: 524,019; python: 11,580; sh: 1,228; makefile: 1,169; xml: 507; javascript: 150; sql: 56; exp: 41; perl: 37
file content (50 lines) | stat: -rw-r--r-- 2,078 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
name: "Weekly changelog update"

on:
  schedule:
    - cron: "45 0 * * 1"
  push:
    branches:
      - master
    paths:
      - '.github/workflows/weekly-changelog.yml'

jobs:
  weekly-changelog:
    if: github.repository == 'CleverRaven/Cataclysm-DDA'
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
      - name: "Get current date"
        uses: 1466587594/get-current-time@v2
        id: current-date
        with:
          format: 'YYYYMMDD'
      - name: "Get changes since last week"
        id: getting-changes
        env:
          CURR_DATE: ${{ steps.current-date.outputs.formattedTime }}
        run: |
          LAST_WEEK="$(date -d "@$(( $(date +%s -d $CURR_DATE) - (60*60*24*7) ))" +"%Y-%m-%d")"
          tools/generate_changelog.py -f --by-date /tmp/changelog.txt -T "${{ secrets.GITHUB_TOKEN }}" "$LAST_WEEK"
          tac /tmp/changelog.txt > /tmp/changelog_rev.txt
          tools/merge_summaries.sh /tmp/changelog_rev.txt data/changelog.txt
          echo "date=$( date +"%Y-%m-%d" -d $CURR_DATE )" >> $GITHUB_OUTPUT
          echo "old_date=$LAST_WEEK" >> $GITHUB_OUTPUT
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v4
        with:
          commit-message: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
          committer: David Seguin <davidseguin@live.ca>
          author: David Seguin <davidseguin@live.ca>
          token: ${{ secrets.TX_PR_CREATOR }}
          branch: changelog-weekly-${{ steps.getting-changes.outputs.date }}
          delete-branch: true
          base: master
          title: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
          body: "#### Summary\nNone\n\n#### Additional context\n`Automatically generated as a draft. Please copy-edit before merging.`"
          labels: Organization,<Documentation>
          # create as a draft to allow maintainers to cull the changes before merging
          draft: true