Skip to content

Commit

Permalink
add: documentation - 1
Browse files Browse the repository at this point in the history
  • Loading branch information
luizfernandolj committed Nov 29, 2024
1 parent f2e4b70 commit 93790c6
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 100 deletions.
40 changes: 40 additions & 0 deletions commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Commit and Push

on:
# Dispara manualmente via workflow_dispatch
workflow_dispatch:
inputs:
commit_message:
description: 'Mensagem do commit'
required: true
default: 'Commit automático via GitHub Actions'

jobs:
commit-push:
runs-on: ubuntu-latest

steps:
# 1. Fazer checkout do repositório
- name: Checkout Repository
uses: actions/checkout@v3

# 2. Configurar as credenciais Git com os Secrets
- name: Set Git Config
run: |
git config --global user.name "${{ secrets.GH_USERNAME }}"
git config --global user.email "${{ secrets.GH_EMAIL }}"
# 3. Fazer alterações (exemplo: criar ou modificar algo)
- name: Make Changes
run: |
echo "Alteração automática em $(date)" >> update.txt
git add .
git commit -m "${{ github.event.inputs.commit_message }}" || echo "Nenhuma alteração para commitar"
# 4. Enviar o commit para a branch master
- name: Push Changes
env:
TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
git push origin master
Loading

0 comments on commit 93790c6

Please sign in to comment.