-
Notifications
You must be signed in to change notification settings - Fork 215
45 lines (38 loc) · 1.43 KB
/
promote-to-stage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Promote to Stage
permissions:
# This is required for requesting the OIDC token
id-token: write
on:
workflow_dispatch:
inputs:
build-number:
type: number
description: Build number used to build artifact to be promoted
jobs:
validate-build:
runs-on: ubuntu-latest
steps:
- name: Setup jfrog shell
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ vars.JFROG_PLATFORM_URL }}
with:
oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }}
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
- name: Get info
id: get-build-info
run: |
echo build-info=$(jf rt curl /api/build/clients-java-push-to-dev/${{ inputs.build-number }}) >> $GITHUB_OUTPUT
- name: Get commit hash from repo
id: get-commit-hash
run: |
echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT
- name: Get build name
id: get-build-name
run: |
echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.name') >> $GITHUB_OUTPUT
- name: Debug
run: |
echo "commit-hash: ${{ steps.get-commit-hash.outputs.commit-hash }}"
echo "build-name: ${{ steps.get-build-name.outputs.build-name }}"
echo "build-number: ${{ steps.get-build-info.outputs.build-info }}"