Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/nightly-package-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Nightly Package Update

on:
workflow_dispatch:
inputs:
dryrun:
default: false
type: boolean
description: Dry Run
schedule:
- cron: '0 1 * * *'

jobs:
Nightly_Package_Update:
uses: 51Degrees/common-ci/.github/workflows/nightly-package-update.yml@main
with:
repo-name: ${{ github.event.repository.name }}
org-name: ${{ github.event.repository.owner.login }}
dryrun: ${{ inputs.dryrun || false }}
secrets:
token: ${{ secrets.ACCESS_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/nightly-prs-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
default: false
type: boolean
description: Dry Run
schedule:
- cron: '0 1 * * *'
workflow_run:
workflows: [Nightly Package Update]
types: [completed]

jobs:
Nightly_PRs_to_Main:
Expand Down
19 changes: 19 additions & 0 deletions ci/update-packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
param (
[Parameter(Mandatory=$true)]
[string]$RepoName,
[Parameter(Mandatory=$true)]
[string]$OrgName,
[bool]$DryRun = $false
)

Write-Output "Downloading latest javascript-templates..."
Invoke-WebRequest "https://github.com/$OrgName/javascript-templates/archive/refs/heads/main.zip" -OutFile javascript-templates.zip

Write-Output "Extracting the archive..."
Expand-Archive javascript-templates.zip -DestinationPath .

Write-Output "Updating the package directory..."
Move-Item -Path javascript-templates-main/*.mustache -Destination $RepoName/javascript-templates -Force

Write-Output "Cleaning up..."
Remove-Item javascript-templates.zip, javascript-templates-main -Recurse