8000 add start and end times for binary build · nginx/agent@9c5ee3f · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c5ee3f

Browse files
committed
add start and end times for binary build
1 parent afe16f1 commit 9c5ee3f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/assertion.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,20 @@ jobs:
4848
- name: Gather build dependencies
4949
id: godeps
5050
run: |
51+
if [ -z ${{inputs.branch}} ]; then
52+
echo "No branch input provided, using current branch: $GITHUB_REF_NAME"
53+
else
54+
echo "Checking out branch: ${{inputs.branch}}"
55+
git checkout ${{inputs.branch}}
56+
fi
57+
echo "Current branch: $GITHUB_REF_NAME"
58+
echo "branch_name=$GITHUB_REF_NAME" >> $GITHUB_ENV
5159
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
5260
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV
53-
time_start=$(date +%s)
61+
echo "GO_VERSION=$GO_VERSION"
62+
echo "time_start=$(date +%s)" >> $GITHUB_ENV
5463
OSARCH=${{matrix.osarch}} make build
55-
time_end=$(date +%s)
64+
echo "time_end=$(date +%s)" >> $GITHUB_ENV
5665
echo "Build time: $((time_end - time_start)) seconds"
5766
5867
echo "Getting sha256sum of the built nginx-agent binary..."
@@ -67,7 +76,7 @@ jobs:
6776
id: assertiondoc
6877
uses: nginxinc/compliance-rules/.github/actions/assertion@main
6978
with:
70-
artifact-name: nginx-agent_${{ github.ref_name }}_${{ matrix.osarch }}
79+
artifact-name: nginx-agent_${{ env.branch_name }}_${{ matrix.osarch }}
7180
artifact-digest: ${{ env.agent-digest }}
7281
build-type: 'github'
7382
builder-id: 'github.com'
@@ -77,10 +86,10 @@ jobs:
7786
artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
7887
artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
7988
artifactory-repo: 'f5-nginx-go-local-approved-dependency'
80-
assertion-doc-file: assertion_nginx-agent_test_${{matrix.osarch}}.json
89+
assertion-doc-file: assertion_nginx-agent_${{env.branch_name}}_${{matrix.osarch}}.json
8190
build-content-path: ${{ env.goversionm }}
82-
started-on: ''
83-
finished-on: ''
91+
started-on: '${{ env.time_start }}'
92+
finished-on: '${{ env.time_end }}'
8493

8594
- name: Sign and Store Assertion Document
8695
id: sign

0 commit comments

Comments
 (0)
0