Skip to content

Mimic registry PR

Mimic registry PR #100

#
# Copyright 2021-2022 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Check Architectures
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
check_architectures:
name: Check Stack and Sample Architectures
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install yq command
uses: redhat-actions/openshift-tools-installer@144527c7d98999f2652264c048c7a9bd103f8a82 # v1
with:
source: 'github'
github_pat: ${{ secrets.GITHUB_TOKEN }}
# Installs the latest release of yq
yq: 'latest'
- name: Get git diff
id: diff
uses: technote-space/get-diff-action@f27caffdd0fb9b13f4fc191c016bb4e0632844af # v6.4.1
with:
PATTERNS: |
+(stacks)/**/devfile.yaml
extraDevfileEntries.yaml
- name: Print the diff
run: echo git diff ${{ env.GIT_DIFF }}
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/number
- name: Check stacks and samples output
continue-on-error: true
run: bash tests/check_architectures.sh "${{ env.GIT_DIFF }}" yq >> ./pr/output
- name: Find Comment in PR
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
id: find
with:
issue-number: ${{ github.event.number }}
comment-author: 'github-actions[bot]'
body-includes: Please check if your stack/sample devfile has architectures mentioned.
- name: Save Comment ID
if: ${{ steps.find.outputs.comment-id != '' }}
run: echo ${{ steps.find.outputs.comment-id }} > ./pr/commentid
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: pr
path: pr/