Skip to content

Commit

Permalink
Directly PR milestone updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jdswinbank committed Aug 7, 2020
1 parent 9e44acc commit b01dd97
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/trigger-updates.yaml
Expand Up @@ -6,16 +6,38 @@ on:
- master

jobs:
generate:
update-docs:
runs-on: ubuntu-latest
strategy:
matrix:
repo: [lsst-dm/dmtn-158]
steps:
- name: Trigger ${{ matrix.repo }} update
- uses: actions/checkout@v2
with:
token: ${{ secrets.ROBO_JDS_PAT }}
repository: ${{ matrix.repo }}
fetch-depth: 0
submodules: true

- name: Update milestones submodule
run: git submodule update --remote --force milestones

- name: Create commit
run: |
curl --request POST \
--header "Accept: application/vnd.github.v3+json" \
--data '{"ref": "master"}' \
--header 'authorization: Bearer ${{ secrets.DOC_UPDATE }}' \
https://api.github.com/repos/${{ matrix.repo }}/actions/workflows/update-milestones.yaml/dispatches
git config user.name github-actions
git config user.email github-actions@github.com
git add milestones
git commit -m "Update milestones submodule"
- name: Get date
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d %H:%M:%S")"
shell: bash

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ROBO_JDS_PAT }}
branch: update-milestones
branch-suffix: timestamp
title: Automatic milestone submodule update, ${{ steps.get-date.outputs.date }}

0 comments on commit b01dd97

Please sign in to comment.