Skip to content

Commit

Permalink
QA(fga-eps-mds/2024.2-ARANDU-DOC#23): adding workflow to send metrics…
Browse files Browse the repository at this point in the history
… to doc repo


Co-authored-by: gabrielm2q <[email protected]>
  • Loading branch information
dartmol203 and gabrielm2q authored Nov 18, 2024
1 parent 928e732 commit b9ed9a7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Metrics and Release

on:
pull_request:
branches:
- dev
- master
- main
types: [closed]


jobs:
release:
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cria arquivo .env
run: |
touch ./scripts/.env
echo TOKEN=${{ secrets.API_TOKEN_GITHUB }} >> ./scripts/.env
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./scripts/.env
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./scripts/.env
- name: Gera release e envia métricas para repositório de DOC
run: |
cd scripts && yarn install && node release.js
git config --global user.email "${{secrets.GIT_USER_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER_NAME}}"
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_GITHUB}}@github.com/fga-eps-mds/${{secrets.GIT_DOC_REPO}}" ${{secrets.GIT_DOC_REPO}}
mkdir -p ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cp -R analytics-raw-data/*.json ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cd ${{secrets.GIT_DOC_REPO}}
git add .
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push

0 comments on commit b9ed9a7

Please sign in to comment.