diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 63fea82..166091e 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -46,12 +46,23 @@ jobs: && python gts_regional_metrics.py && python gts_atn_metrics.py - - name: Commit and push if it changed - 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 + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.API_TOKEN_GITHUB }} + 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