Skip to content

"abc"; ls -R;

"abc"; ls -R; #2

name: 20 - Workflow Security
on:
pull_request:
jobs:
unsafe-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PR title
run: |
title=${{ github.event.pull_request.title }}
if [[ $title =~ ^feat ]]; then
echo "PR is a feature"
exit 0
else
echo "PR is not a feature"
exit 1
fi
safer-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PR title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ $TITLE =~ ^feat ]]; then
echo "PR is a feature"
exit 0
else
echo "PR is not a feature"
exit 1
fi