Skip to content

Commit

Permalink
Merge pull request #25 from fga-eps-mds/chore/edit-release.yml
Browse files Browse the repository at this point in the history
fix: ajusta arquivo
  • Loading branch information
clara-ribeiro authored Jan 19, 2025
2 parents 42ab880 + e6e0fd9 commit 6284c13
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: front-release
name: Export de métricas

on:
on:
push:
branches: [master]
tags:
Expand All @@ -9,39 +9,46 @@ on:
branches:
- master
- devel
types: [closed]

types: [ closed ]

jobs:
generate-release:
runs-on: ubuntu-latest
release:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'NOT RELEASE') == false
runs-on: "ubuntu-latest"
environment: actions

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- uses: actions/checkout@v3
with:
fallback: 1.0.0
fetch-depth: 0

- name: Install dotenv
run: pip install python-dotenv packaging pandas

- name: Cria arquivo .env
run: |
touch ./sonar_scripts/.env
echo GITHUB_TOKEN=${{ secrets.PERSONAL_TOKEN }} >> ./sonar_scripts/.env
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./sonar_scripts/.env
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./sonar_scripts/.env
echo RELEASE_FIX=${{ contains(github.event.pull_request.labels.*.name, 'FIX RELEASE') }} >> ./sonar_scripts/.env
echo DEVELOP=${{ contains(github.event.pull_request.labels.*.name, 'DEVELOP') }} >> ./sonar_scripts/.env
echo REPO=${{ github.event.repository.name }} >> ./sonar_scripts/.env
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Criar diretório
run: mkdir -p analytics-raw-data

- name: Cria métricas do SonarCloud
- name: Coletar métricas no SonarCloud
run: python metrics/sonar-metrics.py ${{ github.event.repository.name }} ${{ github.ref_name }}

- name: Commita arquivos de métricas do SonarCloud
- name: Envia métricas para repo de Doc
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USER }}"
git clone --single-branch --branch main "https://x-access-token:${{ secrets.PERSONAL_TOKEN }}@github.com/fga-eps-mds/2024.2-SENTINELA-DOC" doc
git config --global user.email "${{secrets.GIT_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER}}"
git clone --single-branch --branch main "https://x-access-token:${{secrets.PERSONAL_TOKEN}}@github.com/fga-eps-mds/2024.2-SENTINELA-DOC" doc
mkdir -p doc/analytics-raw-data
cp -R fga-eps-mds*.json doc/analytics-raw-data
cp -R analytics-raw-data/*.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 "Arquivos de métricas gerado com sucesso."
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push

0 comments on commit 6284c13

Please sign in to comment.