Skip to content

Commit

Permalink
Merge pull request #3 from theohbrothers/enhancement/ci-add-cron-work…
Browse files Browse the repository at this point in the history
…flow

Enhancement (ci): Add `cron` workflow
  • Loading branch information
leojonathanoh authored Jan 30, 2024
2 parents b6100b6 + 01eac8e commit bf90dcc
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: cron
on:
schedule:
# Run daily
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-versions:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# Admin user must generate a Personal Access Token with 'workflow' permissions, and used to populate the secret named WORKFLOW_TOKEN.
# See: https://stackoverflow.com/questions/68811838/refusing-to-allow-a-personal-access-token-to-create-or-update-workflow
# See: https://stackoverflow.com/questions/66643917/refusing-to-allow-a-github-app-to-create-or-update-workflow
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_TOKEN }} # This configures the git repo to use this token
fetch-depth: 0 # Fetch all branches and tags
- shell: pwsh
run: |
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoRelease
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
1 change: 1 addition & 0 deletions generate/definitions/FILES.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Files' definition
$FILES = @(
'.github/workflows/ci-master-pr.yml'
'.github/workflows/cron.yml'
'.github/release-drafter.yml'
'README.md'
)
29 changes: 29 additions & 0 deletions generate/templates/.github/workflows/cron.yml.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@'
name: cron
on:
schedule:
# Run daily
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-versions:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# Admin user must generate a Personal Access Token with 'workflow' permissions, and used to populate the secret named WORKFLOW_TOKEN.
# See: https://stackoverflow.com/questions/68811838/refusing-to-allow-a-personal-access-token-to-create-or-update-workflow
# See: https://stackoverflow.com/questions/66643917/refusing-to-allow-a-github-app-to-create-or-update-workflow
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_TOKEN }} # This configures the git repo to use this token
fetch-depth: 0 # Fetch all branches and tags
- shell: pwsh
run: |
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoRelease
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
'@

0 comments on commit bf90dcc

Please sign in to comment.