Skip to content

Commit fc2c74f

Browse files
committed
Merge branch 'main' into customDaoFix
2 parents 250f86d + adab3c8 commit fc2c74f

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

.github/actions/ciValidate/action.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ inputs:
77
pools:
88
description: Name of pools to use
99
required: true
10-
baseBranch:
11-
description: The pull request base branch
10+
ref:
11+
description: The head ref of the branch that is proposed to be merged
12+
required: false
13+
baseRef:
14+
description: The sha/ref to the base commit against which this ref will be merged into
1215
required: false
13-
default: "main"
1416
deleteScratch:
1517
description: Delete scratch org after validation
1618
required: false
@@ -35,9 +37,17 @@ runs:
3537
- name: validate
3638
shell: bash
3739
run: |
38-
command="sfp validate --pools ${{ inputs.pools }} --targetdevhubusername ${{ inputs.devhub }} --basebranch ${{ inputs.baseBranch }} --coveragepercent ${{ inputs.coveragePercent }} --mode ${{ inputs.mode }} --logsgroupsymbol "::group::,::endgroup::""
40+
command="sfp validate pools --pools ${{ inputs.pools }} --targetdevhubusername ${{ inputs.devhub }} --coveragepercent ${{ inputs.coveragePercent }} --mode ${{ inputs.mode }} --logsgroupsymbol "::group::,::endgroup::""
41+
42+
if [ "${{ inputs.ref }}" ]; then
43+
command+=" --ref ${{ inputs.ref }}"
44+
fi
45+
46+
if [ "${{ inputs.baseRef }}" ]; then
47+
command+=" --baseRef ${{ inputs.baseRef }}"
48+
fi
3949
40-
if [ ${{ inputs.deleteScratch }} ];
50+
if [ "${{ inputs.deleteScratch }}" ];
4151
then
4252
command+=" --deletescratchorg"
4353
fi

.github/workflows/buildAndPublish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
echo "${yellow}${bold}------------------------------------------------------------------------------------------${reset}"
4949
echo "${yellow}${bold}Check for changes in source code${reset}"
5050
echo "${yellow}${bold}------------------------------------------------------------------------------------------${reset}"
51-
echo "${newLine}"
51+
5252
echo "${yellow}Checking if there has been changes to source code by running git diff on the src folder excluding markdown files${reset}"
5353
5454
if [ "$GITHUB_EVENT_NAME" == "workflow_run" ]; then
@@ -65,7 +65,6 @@ jobs:
6565
6666
echo "${yellow}${bold}Changes:${reset}"
6767
echo "$changes"
68-
echo "${newLine}"
6968
7069
if [ -n "$changes" ]; then
7170
nonMarkdownChanges=$(echo $changes | grep -v '\.md$')
@@ -84,7 +83,6 @@ jobs:
8483
8584
echo "continueWorkflow=$continueWorkflow" >> "$GITHUB_OUTPUT"
8685
87-
echo "${newLine}"
8886
echo "${yellow}${bold}------------------------------------------------------------------------------------------${reset}"
8987
9088
buildAndPublish:
@@ -101,7 +99,7 @@ jobs:
10199
uses: actions/checkout@v4
102100
with:
103101
fetch-depth: 0
104-
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref }}
102+
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref_name }}
105103

106104
- name: "Set Git Config"
107105
run: |
@@ -111,7 +109,7 @@ jobs:
111109
112110
- name: Authenticate node
113111
uses: navikt/sf-platform/.github/actions/authenticateNode@main
114-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
112+
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name }}
115113

116114
- name: Authenticate DevHub
117115
uses: navikt/sf-platform/.github/actions/authenticateOrg@main
@@ -125,6 +123,8 @@ jobs:
125123
with:
126124
devhub: "devhub"
127125
pools: "ciPlatform"
126+
ref: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') && github.event.workflow_run.head_sha || '' }}
127+
baseRef: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') && github.event.workflow_run.pull_requests.base.sha || '' }}
128128

129129
- name: Quick build
130130
uses: navikt/sf-platform/.github/actions/ciQuickBuild@main
@@ -134,18 +134,18 @@ jobs:
134134

135135
- name: Publish artifacts
136136
uses: navikt/sf-platform/.github/actions/publishArtifact@main
137-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
137+
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
138138
with:
139139
nodeToken: ${{ secrets.GITHUB_TOKEN }}
140140

141141
- name: Generate Release Name
142-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
142+
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
143143
id: generate_name
144144
run: |
145145
echo "releaseName=sf-platform_$(date +%s%3N)" >> $GITHUB_OUTPUT
146146
147147
- name: Generate Release Definition
148-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
148+
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
149149
uses: navikt/sf-platform/.github/actions/generateReleaseDefinition@main
150150
with:
151151
branchToCommitTo: ${{ github.ref }}

0 commit comments

Comments
 (0)