diff --git a/.github/workflows/trigger-updates.yaml b/.github/workflows/trigger-updates.yaml index 63a6533..baf92af 100644 --- a/.github/workflows/trigger-updates.yaml +++ b/.github/workflows/trigger-updates.yaml @@ -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 }}