-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new release action to send release information to pyxis
Signed-off-by: Adam D. Cornett <adc@redhat.com>
- Loading branch information
1 parent
0670106
commit 2c1d0db
Showing
2 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Add Release Info to Pyxis | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
commit: | ||
required: true | ||
type: string | ||
host: | ||
required: true | ||
type: string | ||
secrets: | ||
certificate: | ||
required: true | ||
key: | ||
required: true | ||
certificatePassword: | ||
required: true | ||
|
||
jobs: | ||
call-pyxis-endpoint: | ||
name: Add Release Info | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Environment Variables | ||
env: | ||
CERT_FILE_LOCATION: /tmp/preflight-release.crt | ||
KEY_FILE_LOCATION: /tmp/preflight-release.key | ||
run: | | ||
echo $CERT_FILE_LOCATION >> $GITHUB_ENV | ||
echo $KEY_FILE_LOCATION >> $GITHUB_ENV | ||
- name: Save Certificate and Key | ||
run: | | ||
echo -en "${{ secrets.certificate }}" > $CERT_FILE_LOCATION | ||
echo -en "${{ secrets.key }}" > $KEY_FILE_LOCATION | ||
- name: Call Pyxis API | ||
run: | | ||
curl -s \ | ||
--cert '${{ env.CERT_FILE_LOCATION }}' \ | ||
--key '${{ env.KEY_FILE_LOCATION }}' \ | ||
--pass '${{ secrets.certificatePassword }}' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{"commit":"${{ inputs.commit }}","enabled_for_testing":true,"name":"github.com/redhat-openshift-ecosystem/openshift-preflight","version":"${{ inputs.tag }}"}' \ | ||
-X POST \ | ||
'https://${{ inputs.host }}/v1/tools' | jq | ||
- name: Cleanup | ||
if: always() | ||
run: | | ||
rm -f ${{ env.CERT_FILE_LOCATION }} ${{ env.KEY_FILE_LOCATION }} || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters