Skip to content

meaningless changes to trigger workflow #7

meaningless changes to trigger workflow

meaningless changes to trigger workflow #7

name: buildAndSendSignatures
on:
push:
branches:
- 'master'
paths:
- 'data/**.json'
- 'templates/template.html'
env:
GH_ACTIONS_ENV: true
MODIFIED_PATHS: ${{ toJson(github.event.pusher.changes) }}
jobs:
build_and_send_signatures:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
# https://stackoverflow.com/questions/74265821/get-modified-files-in-github-actions
- name: Get changed files
id: changed-files
run: |
output=""
if ${{ github.event_name == 'pull_request' }}; then
output="$(git diff --name-only -r HEAD^1 HEAD | xargs)"
else
output="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)"
fi
echo "changed_files=${output}" >> $GITHUB_OUTPUT
- name: List changed files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
done
- name: Substitute marks (implicit parameters in env)
run: |
chmod u+x src/substituteMarks.sh
./src/substituteMarks.sh ${{ steps.changed-files.outputs.changed_files }}
- name: Set up nodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Render signatures
run: |
npm install
node ./src/renderSignatures.js
- name: Send emails
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{secrets.EMAIL_USERNAME}}
password: ${{secrets.EMAIL_PASSWORD}}
subject: Actualització de firmes electròniques
to: ${{secrets.INFORMATIC_EMAIL}}, ${{secrets.EMAIL_USERNAME}}
from: ${{secrets.EMAIL_USERNAME}}
body: Aquest missatge ha estat auto-generat.
ignore_cert: true
attachments: ${{ steps.changed-files.outputs.changed_files }}
priority: low