Corrige trigger de pipeline de commit de métricas #22
Workflow file for this run
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
# Aqui buscamos no Sonar um relatório em formato JSON | |
# e enviamos para o repositório de DOC. | |
name: Export de métricas | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
types: [closed] | |
jobs: | |
release: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Criar diretório | |
run: mkdir analytics-raw-data | |
- name: Coletar métricas no SonarCloud | |
run: python parser.py fga-eps-mds-1_2024-1-gerocuidado-apiusuario ${{ github.ref_name }} ${{ github.event.repository.name }} | |
- name: Envia métricas para repo de Doc | |
run: | | |
git config --global user.email "${{secrets.USER_EMAIL}}" | |
git config --global user.name "${{secrets.USER_NAME}}" | |
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_DOC}}@github.com/fga-eps-mds/2024-1-GEROcuidado-Doc" docs | |
mkdir -p docs/analytics-raw-data | |
cp -R analytics-raw-data/*.json docs/analytics-raw-data | |
cd docs/ | |
git add . | |
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}" | |
git push | |
- name: Debugging Information | |
run: | | |
echo "GITHUB REF: ${{ github.ref }}" | |
echo "GITHUB REF_NAME: ${{ github.ref_name }}" | |
echo "GITHUB EVENT_NAME: ${{ github.event_name }}" | |
- name: Envia métricas como assets da release | |
if: startsWith(github.ref, 'refs/tags') | |
uses: AButler/upload-release-assets@v3.0 | |
with: | |
files: 'analytics-raw-data/*' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ github.ref_name }} |