Atualizar flake.lock #26426
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
name: Atualizar flake.lock | |
on: | |
# Permite executar pela UI do GitHub ou pelo API | |
workflow_dispatch: | |
inputs: | |
name: | |
description: Nome do flake input | |
required: true | |
default: gelos-site | |
ref: | |
description: Referência ao flake | |
required: true | |
default: github:gelos-icmc/site | |
context: | |
description: Contexto do bump (por exemplo, URL do PR) | |
required: false | |
jobs: | |
bump: | |
name: Atualizar flake.lock | |
runs-on: ubuntu-latest | |
steps: | |
- name: Instalar nix | |
uses: cachix/install-nix-action@v20 | |
- name: Autenticar bot | |
uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: 251209 | |
private_key: ${{ secrets.GELOS_BOT_KEY }} | |
- name: Configurar git | |
run: | | |
git config --global user.name "gelos-bot" | |
git config --global user.email "gelos-bot[bot]@users.noreply.github.com" | |
- name: Baixar repositório | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Atualizar flake | |
run: | | |
nix flake lock \ | |
--accept-flake-config \ | |
--override-input ${{ inputs.name }} ${{ inputs.ref }} \ | |
|& grep -v "warning" | tee update_message | |
- name: Commitar lock | |
run: | | |
git commit flake.lock \ | |
-m "flake/lock: atualizar ${{ inputs.name }}" \ | |
-m "$(cat update_message)" \ | |
-m "${{ inputs.context }}" \ | |
&& git push origin main \ | |
|| echo "Nada para commitar" |