Skip to content

Commit

Permalink
Add training request workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
richford committed Oct 19, 2024
1 parent 71dec0a commit 2c31996
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/acknowledgment-request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TEAM_MEMBERS=$(gh api orgs/yeatmanlab/teams/roar/members --jq '.[].login')

for MEMBER in $TEAM_MEMBERS
do
ISSUE_BODY="Please acknowledge that you have reviewed the Data Privacy and Information Security Manual and accompanying documents by commenting 'Acknowledged' below."
gh issue create --title "Acknowledgment Request for $MEMBER" --body "$ISSUE_BODY" --assignee $MEMBER
ISSUE_BODY="@$MEMBER, it is time for the quarterly review of ROAR's information security materials. Please review the Data Privacy and Information Security Manual and SDLC policies in this repository. When you are done, comment 'Confirmed' below and a bot will take care of closing this issue."
gh issue create --title "Acknowledgment request for $MEMBER" --body "$ISSUE_BODY" --assignee $MEMBER
done
```
4 changes: 2 additions & 2 deletions .github/workflows/log-acknowledgment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:

# First, we add conditions to check if the comment contains "Acknowledged",
# if the comment comes from the assignee, and if the issue is an acknowledgment issue.
if: contains(github.event.comment.body, 'Acknowledged') &&
if: contains(github.event.comment.body, 'Confirmed') &&
github.event.issue.assignee.login == github.event.comment.user.login &&
contains(github.event.issue.title, 'Acknowledgment')
contains(github.event.issue.title, 'Acknowledgment request')

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/request-acknowledgment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Annual Employee Acknowledgment
name: Request Employee Acknowledgment

on:
schedule:
- cron: '0 0 1 1,7 *' # Runs at midnight on January 1st and July 1st every year
- cron: '0 0 1 1,4,7,10 *' # Runs at midnight on January 1st and July 1st every year
workflow_dispatch: # This enables manual triggering


Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/request-sisa-training.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Request SISA Training Confirmation

on:
schedule:
- cron: '0 0 1 1 *' # Runs at midnight on January 1st and July 1st every year
workflow_dispatch: # This enables manual triggering


jobs:
create-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install GitHub CLI
run: sudo apt-get install gh

- name: Read issue body
id: acknowledgment_request
run: |
CONTENT=$(cat .github/workflows/sisa-training-request-template.md)
echo "content<<EOF" >> $GITHUB_ENV
echo "$CONTENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Get team members and create issues
env:
ISSUE_BODY: ${{ env.content }}
GH_TOKEN: ${{ github.token }}
run: |
gh issue create --title "Create SISA Training Requests" --body "$ISSUE_BODY" --assignee richford
15 changes: 15 additions & 0 deletions .github/workflows/sisa-training-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generate infosec acknowledgment issues

It's time to generate SISA training issues for all of the ROAR developers.

Perform these commands on your command line:

```shell
TEAM_MEMBERS=$(gh api orgs/yeatmanlab/teams/roar-maintainers/members --jq '.[].login')

for MEMBER in $TEAM_MEMBERS
do
ISSUE_BODY="@$MEMBER, it's time for your annual Information Security Training. Please complete a course from the [Stanford Information Security Academy](https://uit.stanford.edu/sisa/training_and_education). When you are done, confirm your training by adding a row to the sisa-training-log.md file in this repository."
gh issue create --title "Training request for $MEMBER" --body "$ISSUE_BODY" --assignee $MEMBER
done
```
5 changes: 5 additions & 0 deletions sisa-training-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ROAR Information Security Training Log

| Developer Name | Date | Training Completed |
| :------------------ | :--------- | :---------------------------- |
| Adam Richie-Halford | 2024-10-19 | SISA - Information Security I |

0 comments on commit 2c31996

Please sign in to comment.