Merge pull request #71 from fga-eps-mds/#131-alertas-homologacao #72
This file contains 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: Generate Metrics Release | |
on: | |
push: | |
branches: [main, develop] | |
tags: | |
- "v*" | |
jobs: | |
send-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: 'Get Previous tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
- name: Create Metrics SonarCloud | |
run: python metrics/sonar-metrics.py ${{ github.event.repository.name }} ${{ github.ref_name }} | |
- name: Commit Metrics SonarCloud File | |
run: | | |
git config --global user.email "${{ secrets.USER_EMAIL }}" | |
git config --global user.name "${{ secrets.USER_USERNAME }}" | |
git clone --single-branch --branch main "https://x-access-token:${{ secrets.PERSONAL_TOKEN }}@github.com/fga-eps-mds/2023-1-Schedula-Doc" doc | |
mkdir -p doc/analytics-raw-data | |
cp -R fga-eps-mds*.json doc/analytics-raw-data | |
cd doc | |
git add . | |
git commit -m "Métricas SonarCloud - ${{ github.event.repository.name }} ${{ github.ref_name }}" | |
git push | |
echo "Metrics File Generated Successfully." |