Skip to content

Add the commint and push step for the json file #7

Add the commint and push step for the json file

Add the commint and push step for the json file #7

name: Copilot Metrics Retention
on:
push:
jobs:
first-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copilot Metrics Retention
uses: ambilykk/copilot-metrics-retention@5b9ef15ce66fc883afb3b6127f960e44d5233a50
with:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
org_name: 'hivemq'
json_path: 'metrics.json'
- uses: actions/upload-artifact@v4
with:
name: metrics.json
path: 'metrics.json'
- name: Commit and push if it changed
run: |
git config --global user.name 'Copilot Metrics Retention'
git config --global user.email 'action@github.com'
git add -A
git diff --quiet && git diff --staged --quiet || git commit -m "Copilot Metrics data update"
git push