mirror of
https://github.com/ansible/awx.git
synced 2026-06-12 10:17:45 -02:30
* Fix bash operator precedence in repo ownership check The condition had || operators outside proper test block grouping, which could cause the check to fail with a shell error. Wrap the OR conditions in parentheses with explicit [[ ]] tests. Assisted-by: Claude Haiku 4.5 <noreply@anthropic.com> * Replace reusable workflow with direct if conditions for repo ownership check The reusable workflow with job dependencies had a timing/evaluation issue where jobs would still execute even when should_run=false. Using direct if conditions with github context variables (repository, ref_name) is more reliable and ensures jobs are properly skipped on fork pushes. Assisted-by: Claude Haiku 4.5 <noreply@anthropic.com> * Remove unused repo-owns-branch reusable workflow No longer needed after replacing with direct if conditions. Assisted-by: Claude Haiku 4.5 <noreply@anthropic.com>
54 lines
1.9 KiB
YAML
54 lines
1.9 KiB
YAML
---
|
|
name: Upload API Schema
|
|
|
|
env:
|
|
LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- devel
|
|
- release_**
|
|
- feature_**
|
|
- stable-**
|
|
jobs:
|
|
push:
|
|
if: |
|
|
github.event_name == 'workflow_dispatch' ||
|
|
(github.repository == 'ansible/awx' && (github.ref_name == 'devel' || startsWith(github.ref_name, 'feature_'))) ||
|
|
(github.repository == 'ansible/tower' && (startsWith(github.ref_name, 'stable-') || startsWith(github.ref_name, 'release_')))
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Build awx_devel image to use for schema gen
|
|
uses: ./.github/actions/awx_devel_image
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
private-github-key: ${{ secrets.PRIVATE_GITHUB_KEY }}
|
|
|
|
- name: Generate API Schema
|
|
run: |
|
|
DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \
|
|
COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \
|
|
docker run -u $(id -u) --rm -v ${{ github.workspace }}:/awx_devel/:Z \
|
|
--workdir=/awx_devel `make print-DEVEL_IMAGE_NAME` /start_tests.sh genschema
|
|
|
|
- name: Upload API Schema
|
|
uses: keithweaver/aws-s3-github-action@4dd5a7b81d54abaa23bbac92b27e85d7f405ae53
|
|
with:
|
|
command: cp
|
|
source: ${{ github.workspace }}/schema.json
|
|
destination: s3://awx-public-ci-files/${{ github.event.repository.name }}/${{ github.ref_name }}/schema.json
|
|
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY }}
|
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }}
|
|
aws_region: us-east-1
|
|
flags: --acl public-read --only-show-errors
|