Skip to content

I improved this code under training process #21

I improved this code under training process

I improved this code under training process #21

name: Exercise Workflow
# Controls when the workflow will run
on:
# Triggers the workflow on pull request events
pull_request_target:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
HandleResults:
runs-on: ubuntu-latest
name: Forwarding Results.
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Zip Release
uses: TheDoctor0/zip-release@0.7.1
with:
filename: "${{ github.event.pull_request.user.login }}_FromPR.zip"
exclusions: '*.git*'
- uses: licenseware/send-email-notification@v1
with:
api-key: ${{ secrets.SENDGRID_API_KEY }}
subject: (DevOpsExercise)DevOpsExercise1_PR_${{ github.event.pull_request.user.login }}
from-email: devops-exercise-noreply@skyline.be
to-email: ${{ secrets.MAILADDRESS }}
markdown-body: |
This is an automatic e-mail containing devops exercise results for ${{ github.repository }}. The attachment is a pull request made by user ${{ github.event.pull_request.user.login }}.
attachments: ./${{ github.event.pull_request.user.login }}_FromPR.zip
attachments-disposition: attachment
- name: Close Pull
run: gh pr close ${{ github.event.number }} --comment "Auto-closing pull request. Results were forwarded to Skyline." --delete-branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}