forked from microsoft/WhatTheHack
-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (33 loc) · 1.24 KB
/
Copy pathcreate-new-hack.yml
File metadata and controls
36 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Create new hack
on:
workflow_dispatch:
inputs:
hackName:
description: The name of the hack you want to create
required: true
default: YetAnotherHack
numberOfChallenges:
description: The number of challenges you want (note that it is better to auto-generate more challenges than you think you will need, you can always delete the files later)
required: true
default: '3'
jobs:
createNewWhatTheHackTemplate:
runs-on: ubuntu-latest
permissions:
contents: write
env:
BRANCH_NAME: xxx-${{ github.event.inputs.hackName }}
steps:
- uses: actions/checkout@v4
- name: Create new branch
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git checkout -b ${{ env.BRANCH_NAME }}
- name: Generate WhatTheHack template stubs
run: ${{ github.workspace }}/.github/workflows/create-wth-template.sh -p ${{ github.workspace }} -c ${{ github.event.inputs.numberOfChallenges}} -n ${{ github.event.inputs.hackName }} -v -d
- name: Push branch
run: |
git add *
git commit -m 'Created WhatTheHack template stub'
git push -u origin ${{ env.BRANCH_NAME }}