Jenkins: On branch or tag creation or deletion, trigger scan repository #1
This file contains hidden or 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
| name: "Jenkins: On branch or tag creation or deletion, trigger scan repository" | |
| on: | |
| create: {} | |
| delete: {} | |
| workflow_dispatch: {} | |
| jobs: | |
| trigger-scan: | |
| runs-on: | |
| group: cps | |
| labels: | |
| - self-hosted | |
| - X64 | |
| - Linux | |
| - minimal | |
| env: | |
| GITHUB_JSON: ${{toJson(github)}} | |
| steps: | |
| - name: Show GitHub information | |
| run: echo "${GITHUB_JSON}" | |
| - name: Get SSL certificates | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| docker/CSIRO-Internal-CA1.crt | |
| docker/CSIRO-Internal-Root.crt | |
| sparse-checkout-cone-mode: false | |
| - name: Set up SSL certificates | |
| run: | | |
| # Set up SSL certificates | |
| CERTIFICATES=( | |
| docker/CSIRO-Internal-CA1.crt | |
| docker/CSIRO-Internal-Root.crt | |
| ) | |
| for CERTIFICATE in "${CERTIFICATES[@]}"; do | |
| HASH="$(openssl x509 -hash -noout -in "${CERTIFICATE}")" | |
| LINK="$(dirname "${CERTIFICATE}")/${HASH}.0" | |
| rm --force "${LINK}" | |
| ln --symbolic "$(basename "${CERTIFICATE}")" "${LINK}" | |
| done | |
| - name: Trigger scan (rcvd) | |
| run: > | |
| curl | |
| --capath docker | |
| --fail-with-body | |
| --request POST | |
| --user "${{secrets.CPS_JENKINS_USER}}:${{secrets.CPS_JENKINS_TOKEN}}" | |
| https://cps-ci.it.csiro.au/job/IAEA-RCVD/job/rcvd/build |