Skip to content

Commit 589f647

Browse files
Merged Pull Request '#33 nightly-package-update->main : Add nightly-package-update workflow'
Add nightly-package-update workflow
2 parents c0d74d7 + e801b82 commit 589f647

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Nightly Package Update
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryrun:
7+
default: false
8+
type: boolean
9+
description: Dry Run
10+
schedule:
11+
- cron: '0 1 * * *'
12+
13+
jobs:
14+
Nightly_Package_Update:
15+
uses: 51Degrees/common-ci/.github/workflows/nightly-package-update.yml@main
16+
with:
17+
repo-name: ${{ github.event.repository.name }}
18+
org-name: ${{ github.event.repository.owner.login }}
19+
dryrun: ${{ inputs.dryrun || false }}
20+
secrets:
21+
token: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/nightly-prs-to-main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ on:
77
default: false
88
type: boolean
99
description: Dry Run
10-
schedule:
11-
- cron: '0 1 * * *'
10+
workflow_run:
11+
workflows: [Nightly Package Update]
12+
types: [completed]
1213

1314
jobs:
1415
Nightly_PRs_to_Main:

ci/update-packages.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
param (
2+
[Parameter(Mandatory=$true)]
3+
[string]$RepoName,
4+
[Parameter(Mandatory=$true)]
5+
[string]$OrgName,
6+
[bool]$DryRun = $false
7+
)
8+
9+
Write-Output "Downloading latest javascript-templates..."
10+
Invoke-WebRequest "https://github.com/$OrgName/javascript-templates/archive/refs/heads/main.zip" -OutFile javascript-templates.zip
11+
12+
Write-Output "Extracting the archive..."
13+
Expand-Archive javascript-templates.zip -DestinationPath .
14+
15+
Write-Output "Updating the package directory..."
16+
Move-Item -Path javascript-templates-main/*.mustache -Destination $RepoName/javascript-templates -Force
17+
18+
Write-Output "Cleaning up..."
19+
Remove-Item javascript-templates.zip, javascript-templates-main -Recurse

0 commit comments

Comments
 (0)