Add the commint and push step for the json file - update permissions #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Copilot Metrics Retention | |
on: | |
push: | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
actions: write | |
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 |