From 490470ec7e8f1327c05ecd14abaa5f5b9fc14971 Mon Sep 17 00:00:00 2001 From: Filipe Date: Tue, 30 Apr 2024 21:06:01 +0200 Subject: [PATCH] move away from direct commits (#65) --- .github/workflows/metrics.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 63fea82..71092cf 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -46,12 +46,24 @@ jobs: && python gts_regional_metrics.py && python gts_atn_metrics.py - - name: Commit and push if it changed + - name: Create Pull Request if: github.ref == 'refs/heads/main' - run: > - git config user.name "Automated" - && git config user.email "actions@users.noreply.github.com" - && git add -A - && timestamp=$(date -u) - && git commit -m "Latest data: ${timestamp}" || exit 0 - && git push + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Latest data: $(date -u)" + branch: update-webpage + delete-branch: true + title: "[metrics-ci] webpage auto-update" + body: | + Metrics Webpage auto-udpate. + labels: | + New: Pull Request + Bot + + - name: Check outputs + if: ${{ steps.cpr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file