Skip to content

GitHub Actions Demo #1666

GitHub Actions Demo

GitHub Actions Demo #1666

Workflow file for this run

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/github-action-lock-branch@v0.1
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/github-action-lock-branch@v0.1
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