boletim-diario #681
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: boletim-diario | |
on: | |
schedule: | |
- cron: '55 12 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
issues: write | |
jobs: | |
boletim-diario: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: criar-boletim | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
echo "Iniciando Boletim" | |
# Boletim Diario De Segurança | |
# Atualização e a Instalação de Dependência | |
echo "Atualizando Dependências" | |
sudo apt-get update -y | |
sudo apt -y install libxml2-utils | |
# Comandos Para Criar uma Nova Issue | |
echo "Executando script's" | |
chmod +X ./script.sh | |
bash ./script.sh | |
echo "SCRIPT_DATA=$(date +'%d/%m/%Y')" >> $GITHUB_ENV | |
echo 'SCRIPT_CONTEUDO<<EOF' >> $GITHUB_ENV | |
cat boletim_final.txt >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
# Comandos Para Fechar Issue Aberta | |
echo "Fechando Issue aberta" | |
chmod +X ./number.sh | |
bash ./number.sh | |
var=$(cat numero_final.txt) | |
# If var is "pr" ignore issue close | |
if [ "$var" = "pr" ]; then | |
echo "Issue não será fechada" | |
else | |
gh issue close $var | |
fi | |
- uses: JasonEtco/create-an-issue@v2 | |
id: create-issue | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DATA: ${{ env.SCRIPT_DATA }} | |
with: | |
filename: .github/boletim.md | |
- name: Create comment | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
issue-number: ${{ steps.create-issue.outputs.number }} | |
reactions: '+1' | |
body: | | |
${{ env.SCRIPT_CONTEUDO }} |