REC-197: Implementa entorno de testing con contenedores #33
This file contains hidden or 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: PR conflict label | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| conflicts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check conflicts | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const { owner, repo } = context.repo; | |
| const issue_number = pr.number; | |
| if (pr.mergeable_state === 'dirty') { | |
| await github.rest.issues.addLabels({ | |
| owner, | |
| repo, | |
| issue_number, | |
| labels: ['Conflictos'] | |
| }); | |
| } else { | |
| try { | |
| await github.rest.issues.removeLabel({ | |
| owner, | |
| repo, | |
| issue_number, | |
| name: 'Conflictos' | |
| }); | |
| } catch (e) { | |
| // label no existía | |
| } | |
| } |