Skip to content

Commit

Permalink
pruebas automatica intento 36 -> actualizacion de commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hernanatn committed Jan 14, 2025
1 parent 2916472 commit 7ab3c9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/pruebas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,27 @@ jobs:
uses: actions/github-script@v6
with:
script: |
// Determinar el resultado de las pruebas
const testOutcome = (steps.ejecutar_pruebas.outcome === 'success') ?
'✔ Todas las pruebas pasaron correctamente.' :
const core = require('@actions/core');
const github = require('@actions/github');
// Determine the outcome of the 'Ejecutar Pruebas' step
const testOutcome = github.context.payload.workflow_run.conclusion === 'success' ?
'✔ Todas las pruebas pasaron correctamente.' :
'❌ Las pruebas fallaron.';
const comment = `Resultado de las pruebas:\n\n${testOutcome}`;
// Actualizar la descripción del pull request si es un PR
if (context.payload.pull_request) {
// Update PR description if it's a PR
if (github.context.payload.pull_request) {
await github.rest.pulls.update({
...context.repo,
pull_number: context.payload.pull_request.number,
body: (context.payload.pull_request.body || '') + `\n\n${comment}`,
...github.context.repo,
pull_number: github.context.payload.pull_request.number,
body: (github.context.payload.pull_request.body || '') + `\n\n${comment}`,
});
} else {
// Agregar un mensaje de estado para commits directos
// Add a commit status message for direct commits
await github.rest.repos.createCommitStatus({
...context.repo,
sha: context.sha,
...github.context.repo,
sha: github.context.sha,
state: testOutcome.includes('✔') ? 'success' : 'failure',
description: testOutcome,
context: 'Resultados de las pruebas',
Expand Down
1 change: 1 addition & 0 deletions pruebas/ejemplo_division.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "errores--.hpp"
#include <iostream>

res::Resultado<int> dividir(int a, int b) {
if (b == 0) {
return res::Resultado<int>(0, err::ERROR, "No se puede dividir por cero");
Expand Down

0 comments on commit 7ab3c9c

Please sign in to comment.