-
-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (39 loc) · 1.2 KB
/
keep-alive.yml
File metadata and controls
45 lines (39 loc) · 1.2 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
36
37
38
39
40
41
42
43
44
45
name: Keep alive
on:
workflow_call:
inputs:
repository:
description: "The repository to keep alive (e.g. 'prolog')"
required: true
type: string
secrets:
pat_empty_commits:
description: "The github token used to author the empty commits"
required: false
workflow_dispatch:
inputs:
repository:
description: The name of the repo to backup (e.g. 'prolog')
required: false
env:
GIT_USERNAME: "Exercism Bot"
GIT_EMAIL: "66069679+exercism-bot@users.noreply.github.com"
jobs:
keep_alive:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
repository: exercism/${{ inputs.repository || github.event.inputs.repository }}
token: ${{ secrets.pat_empty_commits }}
fetch-depth: 0
ref: main
- name: Configure the git user
run: |
git config --global user.email "${GIT_EMAIL}"
git config --global user.name "${GIT_USERNAME}"
- name: Create and push an empty commit
run: |
git commit --allow-empty -m "Empty commit"
git push origin main