forked from devrel-kr/HackaLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.47 KB
/
team-requested.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: On Team Page Requested
on:
workflow_dispatch:
inputs:
teamName:
description: The name of team
required: true
default: Team_HackaLearn
content:
description: The content of the file to be created
required: true
default: Hello HackaLearn
jobs:
create_team_page:
name: 'Create a team page'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Create team page
uses: DamianReeves/write-file-action@master
with:
path: "./teams/${{ github.event.inputs.teamName }}.md"
contents: ${{ github.event.inputs.content }}
write-mode: overwrite
- name: Check team page
shell: pwsh
run: |
Get-Content -Path "./teams/${{ github.event.inputs.teamName }}.md"
- name: Commit team page
shell: bash
run: |
git config --local user.email "[email protected]"
git config --local user.name "HackaLearn Korea"
git add ./teams/\* --force
git commit -m "Team: ${{ github.event.inputs.teamName }} added"
- name: Push team page
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}