-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2e4b70
commit 93790c6
Showing
4 changed files
with
375 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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
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 |
Oops, something went wrong.