-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.33 KB
/
demo.yml
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
name: GitHub Actions Demo
on:
schedule:
- cron: "0 * * * *" # Every Hour
push:
branches:
- main
workflow_dispatch:
jobs:
Schedule:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Schedule Branch Lock
id: schedule
uses: ./
with:
config: ${{ vars.SCHEDULE }}
- run: echo steps.schedule.outputs.UNLOCK=${{ steps.schedule.outputs.UNLOCK }}
- run: echo steps.schedule.outputs.LOCK_WEEKENDS=${{ steps.schedule.outputs.LOCK_WEEKENDS }}
- run: echo steps.schedule.outputs.LOCK_CUSTOM=${{ steps.schedule.outputs.LOCK_CUSTOM }}
- name: Lock branch
uses: JustinDFuller/[email protected]
if: ${{ steps.schedule.outputs.LOCK_WEEKENDS == 'true' || steps.schedule.outputs.LOCK_CUSTOM == 'true' }}
with:
token: ${{ secrets.EXAMPLE_TOKEN_FOR_GITHUB_ACTION }}
branch: main
lock: true
- name: UnLock branch
uses: JustinDFuller/[email protected]
if: ${{ steps.schedule.outputs.UNLOCK == 'true' && steps.schedule.outputs.LOCK_WEEKENDS == 'false' && steps.schedule.outputs.LOCK_CUSTOM == 'false' }}
with:
token: ${{ secrets.EXAMPLE_TOKEN_FOR_GITHUB_ACTION }}
branch: main
lock: false