Skip to content

Allow to launch example-cnf without launching the test scripts #499

Allow to launch example-cnf without launching the test scripts

Allow to launch example-cnf without launching the test scripts #499

Workflow file for this run

name: PR build
on:
pull_request:
branches:
- main
env:
QUAY_REGISTRY: quay.io
RH_REGISTRY: registry.redhat.io
defaults:
run:
shell: bash
jobs:
build_pr:
# Build only when the PR comes from a branch in the same repo or forced
if: github.repository == github.event.pull_request.head.repo.full_name || inputs.force_build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
registry: ${{ env.QUAY_REGISTRY }}
- name: Log in to registry.redhat.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.RH_REGISTRY_USER }}
password: ${{ secrets.RH_REGISTRY_TOKEN }}
registry: ${{ env.RH_REGISTRY }}
- name: Build All
run: |
env
set -x
URL="${{ github.event.pull_request._links.self.href }}"
echo "URL=$URL"
if curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" -H "X-GitHub-Api-Version: 2022-11-28" "$URL"|jq -r .body|grep -qi '^Test-Hints:.*force-build=true'; then
FORCE_BUILD=true
else
FORCE_BUILD=false
fi
echo "sha=${{ github.event.pull_request.head.sha }}"
SHA=$(cut -c1-8 <<< ${{ github.event.pull_request.head.sha }})
make version
echo "force_build=${{ github.event.inputs.force_build }}"
make all SHA=${SHA} DATE=pr${{ github.event.number }} FORCE_BUILD=$FORCE_BUILD