conventional-changelog / commitlint

📓 Lint commit messages
https://commitlint.js.org
MIT License
16.93k stars 912 forks source link

feat(Update ci-setup.md): atualizando github action #4132

Open JefteCosta opened 2 months ago

JefteCosta commented 2 months ago

Atualizando github action para a versão 4 com node 20.x lts

Description

Essa atualização e referente a pagina de CI Setup para github Action o modelo anterio tinha um bug referente as permições da criação de pastas para instalação do nodejs

Motivation and Context

essa mudanção é nessesaria devido ao bug do yml para github action nao esta funcinando, com essa atualização ira funcionar normalmente.

Usage examples

name: CI

on: [push, pull_request]
permissions:
  contents: write
  pull-requests: write

jobs:
  commitlint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20.x'
      - name: Print versions
        run: |
          git --version
          node --version
          npm --version
          npx commitlint --version
      - name: Install commitlint
        run: |
          npm install conventional-changelog-conventionalcommits
          npm install commitlint@latest

      - name: Validate current commit (last commit) with commitlint
        if: github.event_name == 'push'
        run: npx commitlint --last --verbose

      - name: Validate PR commits with commitlint
        if: github.event_name == 'pull_request'
        run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

How Has This Been Tested?

percebi que al ultizar o modelo do action de exemplo do site para o github estava dando erro de permição como a imagem de exemplo abaixo descreve: image

Ao ultilizar o modelo do action descrito acima para subistitur no site do commitlint ele nao da mais esse erro nomo a imagem abaixo descreve: image

Types of changes

Checklist:

codesandbox-ci[bot] commented 2 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

escapedcat commented 2 months ago

Translation:

Updating github action to version 4 with node 20.x lts

Description

This update refers to the CI Setup page for github Action. The previous model had a bug regarding the permissions for creating folders for installing nodejs.

Motivation and Context

This change is necessary due to the bug that the yml for github action is not working. With this update, it will work normally.

escapedcat commented 2 months ago

@knocte I guess this makes sense by now?

knocte commented 2 months ago

Nah, I have a better alternative, let me cook it.

knocte commented 2 months ago

@escapedcat bare with me, I got into a rabbit hole (maybe we're talking 5 or 6 inner levels of yak shaving), but I will eventually come out of it.

escapedcat commented 2 months ago

@knocte no rush! Thanks for diving in! 😄