Skip to content

Commit 747f3fe

Browse files
feat: add projectUrl input (#27)
Add input projectUrl to add project URL to the generated package. Usually associated with the linked Automation Hub project, but if that is not provided a link to the repository is used in its place
1 parent 788dd79 commit 747f3fe

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The scenario illustrated below shows how one can work with providing specific pr
6666
|**orchestratorApplicationScope**|External application scope|False|"OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Jobs OR.Machines.Read OR.Monitoring OR.Robots.Read OR.Settings.Read OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Users.Read"|
6767
|**projectVersion**|A valid semver tag version number (without the leading 'v') to set the version of the packages|True||
6868
|**releaseNotes**|Release notes to be added in the generated .nupkg files|False||
69+
|**projectUrl**|Project URL for the generated package. Usually associated with the Automation Hub project. If not provided, the repository URL will be used|||
6970
7071
## Outputs
7172

action.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ inputs:
3333
releaseNotes:
3434
description: 'Release notes for the package'
3535
required: false
36+
projectUrl:
37+
description: 'Project URL for the generated package. Usually associated with the Automation Hub project. If not provided, the repository URL will be used'
38+
required: false
3639
outputs:
3740
packagesPath:
3841
description: 'Folder containing the generated packages'
@@ -41,6 +44,20 @@ outputs:
4144
runs:
4245
using: "composite"
4346
steps:
47+
- id: set-urls
48+
name: Set URLs
49+
shell: bash
50+
run: |
51+
repoUrl="${{ github.server_url }}/${{ github.repository }}"
52+
echo "repoUrl=$repoUrl" >> $GITHUB_OUTPUT
53+
if [ -z "${{ inputs.projectUrl }}" ]; then
54+
echo "projectUrl=$repoUrl" >> $GITHUB_OUTPUT
55+
echo "projectUrl: $repoUrl"
56+
else
57+
echo "projectUrl=${{ inputs.projectUrl }}" >> $GITHUB_OUTPUT
58+
echo "projectUrl: ${{ inputs.projectUrl}}"
59+
fi
60+
4461
- id: pack
4562
name: Pack
4663
shell: bash
@@ -56,8 +73,6 @@ runs:
5673
projectJsonFiles=$(echo "${{ inputs.projectFilePaths }}" | tr '\r\n' '\n' | sed '/^\s*$/d' | while read -r line; do echo "${{ github.workspace }}/$line"; done)
5774
fi
5875
59-
repoUrl="${{ github.server_url }}/${{ github.repository }}"
60-
6176
while IFS= read -r p; do
6277
echo "::group::uipcli output for packing project: $p"
6378
uipcli package pack "$p" \
@@ -72,10 +87,11 @@ runs:
7287
--releaseNotes "${{ inputs.releaseNotes }}" \
7388
--version "${{ inputs.projectVersion }}" \
7489
-l en-US \
75-
--repositoryUrl "$repoUrl" \
90+
--repositoryUrl "${{ steps.set-urls.outputs.repoUrl }}" \
7691
--repositoryCommit "${{ github.sha }}" \
7792
--repositoryBranch "${{ github.ref_name }}" \
78-
--repositoryType git
93+
--repositoryType git \
94+
--projectUrl "${{ steps.set-urls.outputs.projectUrl }}"
7995
8096
echo "::endgroup::"
8197

0 commit comments

Comments
 (0)