-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 902 Bytes
/
Copy pathgenerate-case.yml
File metadata and controls
37 lines (32 loc) · 902 Bytes
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
36
37
name: Generate Case
on:
issues:
types: [opened]
permissions:
contents: write
jobs:
create:
if: contains(join(github.event.issue.labels.*.name, ' '), 'new-case')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Save issue to README
env:
NUM: ${{ github.event.issue.number }}
TITLE: ${{ github.event.issue.title }}
BODY: ${{ github.event.issue.body }}
run: |
DIR="cases/case-$NUM"
mkdir -p "$DIR"
{
echo "# $TITLE"
echo
echo "$BODY"
} > "$DIR/README.md"
- name: Commit & push
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add cases/
git commit -m "Case #${{ github.event.issue.number }} archived" || true
git push